Magnitude plot over time

2 views (last 30 days)
Drvoljub
Drvoljub on 30 Jul 2011
Hello
I have a problem with a meshplot. I have a transfer function and I must make a magnitude plot. The problem is : I dont know how to make a mesh plot out of it. I attached a picture of the supposed result.
I know what a bode plot is but dont know how to produce this plot.
Regards Karlos

Answers (2)

the cyclist
the cyclist on 30 Jul 2011
You don't give us any detail on what you have tried, or what your data look like, so it is not easy to help you. Here is about the simplest possible mesh you can make, slightly adapted from the MATLAB documentation for meshgrid. Does this help?
xvec = -2:0.2:2;
yvec = -2:0.2:2;
[x,y] = meshgrid(xvec,yvec);
z = x .* exp(-x.^2 - y.^2);
figure
mesh(x,y,z)

Drvoljub
Drvoljub on 30 Jul 2011
hi
Yes I know the basics of the mesh plot
To tell you what I tried: X=[-1:0.5:3] Y=[0:10:40]
For example the transfer function
A=S/s+1
then I tried it with freqsp(A,w) w=[0:10:50]
and then I tried to mesh them together into the mesh command (X,Y,Z)
where Z=H=freqsp(A)
It didnt work.
The datas on the axis are : X axis = log(10) frequency (rad/s) -1:0.5:3 Y axis= time axis 0:10:40 Z axis= Magnitude (dB) -30:10:50
  1 Comment
the cyclist
the cyclist on 31 Jul 2011
I don't understand your description completely.
Have you successfully defined three vectors, (X,Y,Z)?
Have you put those into meshgrid() to get three arrays that can be used in mesh()?
What error are you getting, specifically? It is not very helpful to just say, "It didn't work."
[It would be best if you posted the actual code you used, and the errors you are geting, instead of this semi-mathematical description.]

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots 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!