Unable to plot output after function.
I gave my script below
A = cos(theta).*[1 5 6; 2 9 3; 5 1 0];
B = tan(2*theta).*[8 5 1; 0 1 6; 2 4 7];
myfun = @(t,y)scriptname(t,y,A,B);
sol = ode45(myfun,tspan,y0);
function dydt = scriptname(t,y,A,B)
An = double(subs(A,y(3)));
Bn = double(subs(B,y(3)));
title(['stat current # ',int2str(i)]);
iam getting error like this
Function definitions in a script must appear at the end of the file.
Move all statements after the "scriptname" function definition to before the first local function definition.
How to resolve this??
Thanks in advance