How to plot a function that has a parameter in the interval?
显示 更早的评论
Hello, I am new to MATLAB. I have a piecewise function as follows.

How do I plot the graph of such a function? Any help would be appreciated, thank you!
采纳的回答
更多回答(1 个)
One possibility:
a=1;
f=@(t) exp(t).*(0<t & t<a) + 2*exp(t).*(a<=t);
fplot(f,[0,2*a])
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

