0

In my uni course we are having to develop a matlab script which determines the solutions to specific ODE's. The following system of ODE's is as seen below in the image, with the question following;

Image

I am seriously struggling to understand how to use ODE45 even with the inbuilt MATLAB help function. I have looked at countless of videos but they all don't explain it too well for my level atleast. My current code is as seen below;

function[t,x,y,z] = Ass3(sigma,beta,rho,tmax,x0,y0,z0);
tspan=[0 tmax];
eqdot = [sigma$*$y-sigma$*$x);x$*$rho-x$*$z-y;x$*$y-beta$*$z];

[t,x,y,z] = ode45(eqdot,tspan,[x0,y0,z0])

end

Any help will be greatly appreciated :). Thank you in advance!

JayP
  • 1,096
  • it should work with @eqdot. See here: https://www.mathworks.com/help/matlab/matlab_prog/pass-a-function-to-another-function.html – Dmitry Aug 17 '19 at 13:10
  • Where are you suggesting that I implement this function @Dmitry ? – JayP Aug 17 '19 at 13:19
  • In ode45. You shold write ode45(@eqdot, ... – Dmitry Aug 17 '19 at 17:15
  • I can do that... Except it leads to an error since I have used eqdot as a function. How may I fix this? Also, how would I define my x,y and z. Because they aren't being defined prior. – JayP Aug 17 '19 at 23:15

0 Answers0