How can I plot a function with parametric if (change between parameters)

1 回表示 (過去 30 日間)
chris v
chris v 2016 年 12 月 9 日
編集済み: Mischa Kim 2016 年 12 月 10 日
I have the function :
t(r) = 39.64 if 0<r<r0 and
t(r) = 51.4875* exp( 0.14*(16.37-r)) if r0<r
where r in R(real numbers) and
r0 = 12.5
How I can get the plot/graph of function t(r) ...? Thanks! (Maybe the title question doesn't fit well in the meaning)

採用された回答

Mischa Kim
Mischa Kim 2016 年 12 月 10 日
Chris, this should do the trick
r = 0:0.1:20;
r0 = 12.5;
t = 39.64*(r<=r0) + 51.4875*exp(0.14*(16.37 - r)).*(r>r0);
plot(r,t)

その他の回答 (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