How to access the data from the FFT Analysis tool in the Powergui and use in the workspace
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Sophia Hofmann
2018 年 7 月 27 日
Have you found a solution for your problem? I get the same message and need some help.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spectral Measurements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!