Create custom bode plot
9 views (last 30 days)
Show older comments
I want to create a custom bode plot. The reason for this is because we created a new type of frequency domain analysis for stochastic systems and we are able to compute the variance, and thus the standard deviation, in the frequency domain.
I know I can create an (MIMO) bode plot without any data yet using
h = gca;
InputNames = {'Xin', 'Yin'};
OutputNames = {'Xout', 'Yout'};
h = ltiplot(h,'bode',InputNames,OutputNames,[],cstprefs.tbxprefs);
To make it visible, you have to use
h.Visible = 'on'
Now then I am able to select all the axes using
ax = h.getaxes;
In this case "ax" is an "axes: 2-by-2-by-2" object. It contains 8 axes, 4 for the magnitude plots and 4 for the phase plots. I can select each axes either using "ax(1) ... ax(8)" or by "ax(1,1) ... ax(2,4)"
Now I want to be able to add my own data to each of those axes. I was, for example, hoping to be able to do
semilogx(ax(1,1),freq,mag1)
semilogx(ax(1,2),freq,phase1)
semilogx(ax(1,3),freq,mag2)
semilogx(ax(1,4),freq,phase2)
...
semilogx(ax(2,4),freq,phase4)
However when I execute "semilogx(ax(1,1),freq,mag1)", the bode plot created using "ltiplot" is destroyed and only "semilogx(ax(1,1),freq,mag1)" is shown.
My question is as such, when I created a bodeplot using "ltiplot" how am I able to add data to it?
0 Comments
Answers (1)
Sulaymon Eshkabilov
on 20 May 2019
In this case, in my understanding - not to use ltiplot(). Compute the values of Bode and plot the computed values by employing semilogx().
0 Comments
See Also
Categories
Find more on Plot Customization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!