Two Functions One Graph Different Limits

10 ビュー (過去 30 日間)
student
student 2014 年 10 月 1 日
コメント済み: Dyuman Joshi 2022 年 11 月 21 日
I have two functions I want to plot on one graph with different limits on each graph. So far I can get both functions to plot on the same graph, but I want the first function to plot for x values from 0 to 5 and the second function to plot from 5 to 10. How can I do this?
  1 件のコメント
Dyuman Joshi
Dyuman Joshi 2022 年 11 月 21 日
Do you mean something like this? If not, please give an example of what you want.
x=0:0.01:5;
plot(x,sin(x),'r')
hold on
plot(x+5,cos(x+5),'b')
xticks(0:10)
grid on

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by