hello, i need to draw the given piecewise function then calculate g(t+1), 3*g(t),etc but my code is unable to draw the function. it is not showing any graph, when i delete first function and write the lines separately it says it had to be inside of a function, if i put the first function at the bottom it gives the error of "not enough arguments".
function execute(~)t= -4:0.01:10;plot(t,g(t));endfunction y = g(t) if t<-2 y=0;elseif -2<t & t<0 y=-4-2*t;elseif 0<t & t<4 y=-4+3*t;elseif 4<t & t<8 y=16-2*t;else y=0;endend
Best Answer