How to access the data from the FFT Analysis tool in the Powergui and use in the workspace
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hi
I simulate the circuit in Simulink Matlab and measures its fft using FFT analysis tool in the powergui. now I want to access the values of each harmonic, and THD, and use it in the workspace. I find the related question in the following URL.
https://www.mathworks.com/matlabcentral/answers/99089-how-can-i-access-the-data-from-the-fft-analysis-tool-in-the-powergui-from-the-matlab-command-prompt
sps = power_fftscope(bdroot)
%Sampling time
Ts = sps.FFTdata.t(2)-sps.FFTdata.t(1)
%Samples per cycle
Sc = 1/(Ts*sps.fundamental)
%DC component
DC = sps.mag(1)
%Fundamental frequency
Fc = sps.fundamental
%Total harmonic distortion
THD = sps.THD
I name the scope as voltage. run the Simulink file.then I go to command line and execute the first line of the code.
when I execute first line
sps = power_fftscope(bdroot)
answer comes: sps = []
then next line execute:
Ts = sps.FFTdata.voltage(2)-sps.FFTdata.voltage(1)
this error comes
Attempt to reference field of non-structure array.
what does it means and how to get the data from the FFT` analysis. kindly help me I will be highly thankful to you
0 comentarios
Respuestas (1)
Sophia Hofmann
el 27 de Jul. de 2018
Have you found a solution for your problem? I get the same message and need some help.
0 comentarios
Ver también
Categorías
Más información sobre Spectral Measurements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!