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)
v = 2*t
v = 1.5*t
v = 2*t - 20
v = 10
Create an M‐file that calculates the velocity as function of time and plots the velocity with time. Use if
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,