
Ibrahim M. answered 03/28/23
PhD in Mechanical Engineering with 8 Years of MATLAB coding experience
Hello Lilly,
to start this problem you need to create a time vector. You can use something like "t = 10:-0.125:0" to do what the problem asks for. Then you can loop over the elements of this vector by using something like " for i = 1:length(t)", and inside this loop you use the if-else if statements to account for the different time intervals. For example, you use "if t(i) < = 3 " as one condition, and then elseif " t >3 & t<=5" and so on.
Hope this helps!
Best,
Ibrahim