Magnitude plot over time

2 次查看(过去 30 天)
Drvoljub
Drvoljub 2011-7-30
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

回答(2 个)

the cyclist
the cyclist 2011-7-30
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 2011-7-30
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 个评论
the cyclist
the cyclist 2011-7-31
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.]

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by