Hey guys i´ve just started to work with mathlab and tried to plot my sectionwise function f(t)={t for 0<=t<1, -t+2 for 1<=t<2, else 0} If i want to run my code, i got always the error " Subscripted assignement dimension mismatch". Can someone figure out whats wrong and help me to fix my code. Thx for your support.
if true % code
endclear tclose allclct=1:0.1:5;y(t>=0&t<1)=t;y(t>=1&t<2)=-t+2;y(t<0&t>=2)=0;plot(t,y);
Best Answer