2. The parameters of power module and measuring module are set as follows.
3. The parameters of 3.PLL are set as shown in the figure below.
4. After the operation, the oscilloscope waveform is shown in the following figure, and you can see the accurate phase lock.
Precautions:
The basic data unit of MATLAB is matrix, and its instruction expression is very similar to that commonly used in mathematics and engineering, so it is much simpler to solve problems with MATLAB than to do the same thing with C, FORTRAN and other languages.