MATLAB Answers

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

1 view (last 30 days)
chris v
chris v on 9 Dec 2016
Edited: Mischa Kim on 10 Dec 2016
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)

  0 Comments

Sign in to comment.

Accepted Answer

Mischa Kim
Mischa Kim on 10 Dec 2016
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 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by