Plot two functions on graph

조회 수: 2 (최근 30일)
Austin Haha
Austin Haha 2018년 1월 28일
댓글: Rena Berman 2018년 2월 5일
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