How to get the THD value from the THD block in simulink into matlab
I'm using the demo Simulink model for the THD Block : it opens using the command : power_RMS_THD in Matlab.
Now i want to get the THD value displayed into Matlab (in our case the 50%).
Should i do that from the Display block or from the THD block
How do i do that ?
Solution
Here are two simple solutions:
You add a box "To Workspace" in your Simulink model and connect it with the THD signal. (Simulink Library Browser: Simulink > Sinks > To Workspace) After the simulation, the data is in the field 'Data' of the specified variable (default: simout). So just call "simout.Data" afterwards to obtain the data.
Double click on the scope 2. In the scope dialog box click on the gear and in the scope paramters dialog box on 'History'. There is an option to save also the values in the workspace.