Quantcast
Channel: MATLAB Central Newsreader - tag:"piecewise"
Viewing all articles
Browse latest Browse all 24

Re: Graphing piecewise function with if/ elseif statments

0
0
If you have R2016b and the Symbolic Math Toolbox installed, you can use the piecewise function to recreate this example:

sym t
p = piecewise(0<=t<=10,33,10<=t <=15,33-0.35*(t-10),15<=t<=17.5,33-0.35*(5),17.5<=t<=59/3,33-0.35*(5)-0.65*(t-17.5), 59/3<=t<=74/3,33-0.35*5-0.65*(59/3-17.5));
fplot(p,[0,25]);

Viewing all articles
Browse latest Browse all 24

Latest Images

Trending Articles





Latest Images