What’s wrong?

2 次查看(过去 30 天)
Aurelius Hardy
Aurelius Hardy 2021-2-12
评论: Rik 2021-2-12
what am i doing wrong? plot not showing up. the t&v is in parenthesis
  2 个评论
Kevin Barkett
Kevin Barkett 2021-2-12
Hi there,
It looks like the parenthesis of the variable 't' should not encapsulate that first colon, and also the arguments for the plot command should be contained within parenthesis. Try:
t = 0:(1/6000):(1/30);
v = (4*cos((120*pi*t)+(pi/3)));
plot(t,v);
Cheers, Kevin
Aurelius Hardy
Aurelius Hardy 2021-2-12
thank you

请先登录,再进行评论。

回答(1 个)

Blue
Blue 2021-2-12
Is this what you want ? Works fine.
t = 0:1/6000:1/30
v = (4*cos((120*pi*t) + (pi/3)))
plot(t,v)
  2 个评论
Aurelius Hardy
Aurelius Hardy 2021-2-12
thanks somethings finally coming up but why is it looking like this
Rik
Rik 2021-2-12
The code in the answer should not result in an image like you posted. What exact code did you use?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by