I have two files: 1 file has this code: function xprime = lorenz(t,x); alfa = 0.017; beta = 0.067; tau_e = 0.017; tau_l = 0.0001; tau_j =0.00000001; tau_k =0.00000001; c = 0.000001; p = 0.000001; d = 0.000001; A = 475; xprime = zeros(6,1); t0=20.0; xprime(1) =A*( c1*x(2) + x(3)*tau_k -(tau_l*x(1) - tau_j*x(1))); and so on
second file has this code clear all; x0 = [0 0 0.8 0.2 0 0]; tspan = [0 500]; [t,x]=ode45(@lorenz,tspan,x0); save('A475.mat','x','t')
Because I want to calculate a lot of ode but each with different A - how can i put A value in my second file ?
I was trying like clear all; x0 = [0 0 0.8 0.2 0 0]; tspan = [0 500]; A=475; [t,x]=ode45(@lorenz,tspan,x0,[],A); save('A475.mat','x','t')
but it gives me an error. Undefined function or variable 'A'.
Error in lorenz (line 107) xprime(1) =A*( c1*x(2) + x(3)*tau_k -(tau_l*x(1) - tau_j*x(1)));
Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in run (line 5) [t,x]=ode45(@lorenz,tspan,x0,A);
I'm using matlab version R2017a