Mary, use
function my_ode()
[T,Z] = ode45(@func,[0 2],1); % use correct name of ODE function
plot(T,Z)
end
function z = func(t,y)
z = t./y;
end
Copy-paste the code into a MATLAB function window and safe as my_ode.m.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!