I want to use a loop in the main program to make
a
the different value, and then get different graphics, but without defining
a
in the function file it can't run, how to solve, thank you!
codes are as this
function file
function f = rigid(t,y)syms af = zeros(2,1); % a column vector
f(1) = a*y(2) * y(1);f(2) = -y(1) * y(2);
main program
a=1;options = odeset('RelTol',1e-4,'AbsTol',[1e-4 1e-4]);[T,Y] = ode45(@rigid,[0 12],[1 1],options);plot(T,Y(:,1),'-',T,Y(:,2),'-.')
Best Answer