u and v and r should be vectors.
function [g] = kast(m,k,u,v,n)
g = 9.80;
t = 0:0.1:n;
r = [u.*(m/k).*(1-exp(-k.*t./m),((-m*g/k).*t) + (v.*(m/k).+m^2*g/k^2).*( 1.-exp(-k.*t./m)))];
plot(t,r)
end
I’ve spent about an hour, but I cannot work out what is wrong. Are any of you able to spot my error?
Thank you for your time.
Kind regards,
Marius
looks suspicious. Try remove the dot before the
+. And add a closing bracket before the comma in the assignment ofr.