Plot two functions on graph
3 ビュー (過去 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 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!