Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = 0.01:0.01:10;
- x = zeros(length(t));
- for n = 1: length(t)
- if(t(n) < 6)
- if(t(n) < 4)
- if(t(n) < 2)
- x(n) = t(n)^2;
- else
- x(n) = 4;
- end
- else
- x(n) = -2 * t(n) + 12;
- end
- else
- x(n) = 1/2 * t(n) - 3;
- end
- end
- plot(t,x);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement