Hello
this is what I'm trying to do:
1. A particle moves in a straight line for 40 s. The velocity as a function of time is: (example)
t<10
v = 2*t
10<=t<=25
v = 1.5*t
25<t<=35
v = 2*t - 20
35<t<=40
v = 10
Create an M‐file that calculates the velocity as function of time and plots the velocity with time. Use
if construct.
It's just a question from a textbook for beginners.
What I'm trying to do so far is to declare t = 0:0.1:40 before running the IF, which is not working because whenever I write if t<10 v = 1.4.*t I'm telling the program that when that condition is complied it should multiply 1.4 to the whole "array" t.
I appreciate any help,
Thanks