How to access the data from the FFT Analysis tool in the Powergui and use in the workspace

조회 수: 3 (최근 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

답변 (1개)

Sophia Hofmann
Sophia Hofmann 2018년 7월 27일
Have you found a solution for your problem? I get the same message and need some help.

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by