Please help me how to pl开发者_运维问答ot this equation x2 = x1 + 2.5*cos(230*t)
by adjusting t
as t = 0:0.0001:.01
.
Assuming you want a single line 2D plot and x1 is fixed, try
x1 = <put your number here>
t = 0:0.0001:.01
x2 = x1 + 2.5*cos(230*t)
plot(t, x2)
If you want something fancier like different formatting or a 3D plot, I highly recommend at least skimming through the manual. For surface or mesh plotting, you'll want to look at mesh
, surface
, and probably meshgrid
. Matlab's rich support for plotting is one of its big selling points.
精彩评论