ode45 Matlab system of differential equations
Show older comments
Hi,
I'm new to Matlab and I have been trying to solve/simulate values of my system of ordinary differential equations. Even when I copy and paste examples from the net Matlab tells me that my function is undefined. For example:
function ypsir =ypsir(t,y) a = .01; b = .1; ypsir(1) =-a*y(1)*y(2); ypsir(2) = a*y(1)*y(2)-b*y(2); ypsir(3) = b*y(2); ypsir = [ypsir(1) ypsir(2) ypsir(3)]';
Matlab will respond with
??? Input argument "y" is undefined.
Error in ==> Untitled at 4 ypsir(1) =-a*y(1)*y(2);
Can someone please explain what this means and how to fix it.
Thanks! :)
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!