In this script (where function is a law of motion function=function(y,y',t)) I would like to find the response of the system varying the parameter 'omega'(included in the function as a force m*g*sin(omega*t))
[t,x]=ode45(@function,[0 0+dt],[0;0;0;0]); plot(omega*ones(Nplot,1), x, '.', 'markersize', 2); hold on;
I tried to write a for cycle like:
for w = 10:10:500 [t,x]=ode45(@function,[0 0+dt],[0;0;0;0]); plot(omega*ones(Nplot,1), x, '.', 'markersize', 2); hold on;end,
but if I put omega as a variable of input for 'function' the error that appear is: ??? Input argument "omega" is undefined. how can i do?? thanks a lot!!
Best Answer