MATLAB: About plotting piecewise function.

piecewise

why Matlab says index exceeds matrix dimensions at line 3? Thanks

Best Answer

See if using:
for k = 1:length(t)
instead, works correctly in your code.
Related Question