user576601
user576601

Reputation: 1

How to plot this equation

Please help me how to plot this equation x2 = x1 + 2.5*cos(230*t) by adjusting t as t = 0:0.0001:.01.

Upvotes: 0

Views: 220

Answers (1)

Mr Fooz
Mr Fooz

Reputation: 111986

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.

Upvotes: 3

Related Questions