I'm trying to write a function that has different values on different intervals:
from t0 to t1 needs to be 0
from t1to t2 needs to be a segment that goes linearly from 0 to t1
from t2 to tf needs to be t2
But when I try the code below I get a totally different plot and can't find the error(s).
function z = funz(t,t0,t1,t2,tf)
zz = @(t) ((t2-t1)/(t2-t1))*t;