Im having trouble plugging in values from array s0 into three equations from a previous script(myLorenz). The new s0 values are suppose to be plugged into the S(1), S(2), and S(3) spots in the equations. However Im getting an error message stating
[T, X, Y, Z] = myLorenzSolver([0, 50], [0;1;1.05], 10, 28, 8/3);
"Attempted to access S(2); index out of bounds because numel(S) = 1."
function [T,X, Y, Z] = myLorenzSolver(tSpan, s0, sigma, rho, beta)
t0 = tSpan(1);
tf = tSpan(end);
%integrations
[T, Y] =ode45(@myLorenz,[t0,tf],[sigma,rho,beta]);
end
function [dS] = myLorenz(t,S,sigma,rho,beta)
%dx/dt
dx = sigma*(S(2)-S(1));
%dy/dt
dy = S(1)*(rho-(S(3)))-S(2);
%dz/dt
dz =(S(1)*S(2))-(beta*S(3)) ;
dS = [dx,dy,dz]';
end
Thanks in advance for the help!