How can i export datas on the bode plot in SIMULINK?
13 次查看(过去 30 天)
显示 更早的评论
Hello, I need to exprot data from bode plot block in SIMULINK
I made diagram block and run the SIMULINK file but I couldn't get the data based on frequency(x-axis) and magnitude(y-axis).
I only get 'structure' data... but it dosen't include data what i want
To get datas, I tried to make output port on the Bode plot(To Workspace block) and check 'Save data to workspace' on the logging of Bode plot option
How can i export the data from the bode plot in SIMULINK?
0 个评论
采纳的回答
Arkadiy Turevskiy
2016-12-14
When you run the model with Bode Plot block, with "save data to workspace" enabled, you get a variable sys, or whatever name you specified for it. sys is a structure, like you said. It contain frequency response information in the form of state-spaces matrices A,B,C,D as well as block name and snapshot time when linearization was computed.
To access state space matrices type
sys.values
To get magnitude, phase and frequency data from the bode plot:
[mag,phase,w]=bode(sys.values);
Recreate Bode plot:
semilogx(squeeze(w),20*log10(squeeze(mag)))
subplot(211)
semilogx(squeeze(w),20*log10(squeeze(mag)))
subplot(212)
semilogx(squeeze(w),squeeze(phase))
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!