Plot two functions on graph

2 次查看(过去 30 天)
i(t)=6cos((2*pi*t)-15)
And
v(t)=12sin((2*pi*t)-45))
plot on same graph, should include approx 2 full cycles.
  5 个评论
Rik
Rik 2018-1-29
13 minutes after your post here, he actually edited his question here to change it to essentially this question. Even if teachers don't check (which they might indeed not do for easier questions), the rest of my argument still stands.
Rena Berman
Rena Berman 2018-2-5
(Answers Dev) Restored edit

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2018-1-28
There are three ways:
1)
plot(t, i(t))
hold on
plot(t, v(t))
hold off
2)
plot(t, i(t), t, v(t))
3)
plot(t, [i(t(:)), v(t(:))])
Passing t(:) to the functions should cause them to return column vectors. You then use [,] to put the two column vectors into an n x 2 matrix. MATLAB will treat each column as an independent line to be plotted.

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by