ok for some reason i cant get this function to work.
in one file i have
t=[0:.1:30];
x=postion(t)
plot(t,x)
and in the other file i have
function x=postion(t)
if 0<=t<=10
y=.5*t^2;
elseif 10<=t<=20
y=.5*t^3-t^2+15*t-50;
elseif 20<=t<=30
y=.0025*t^4-.15*t^3+135*t-1650;
end
end
and i cant get it to work
i get errors in both files. in the 1st file i get
??? Undefined function or method 'postion' for input arguments of type 'double'.
Error in ==> g233x23 at 8
x=postion(t)
and in the function file i get
??? Input argument "t" is undefined.
Error in ==> position at 2
if 0<=t<=10