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