Create custom bode plot

9 views (last 30 days)
Wouter
Wouter on 17 Nov 2014
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?

Answers (1)

Sulaymon Eshkabilov
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().

Community Treasure Hunt

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

Start Hunting!