Dear all. I am trying to solve an ODE in MATLAB using ODE45 solver. But the programe keep saying(adsbygoogle = window.adsbygoogle || []).push({});

??? Input argument "y" is undefined.

Error in ==> lvv at 4

yprime=[a*y(1)-b*y(1)*y(2);-r*y(2)+c*y(1)*y(2)];

Can anybody be of help? Please.

The complete code is this:

function yprime=lvv(t,y)

%LV: Contains Lotka-Volterra equations

a=.5471;b=.0281;c=.0266;r=.8439;

yprime=[a*y(1)-b*y(1)*y(2);-r*y(2)+c*y(1)*y(2)];

[t,y]=ode45(@lvv,[0 20],[30;4])

plot(t,y(:,1))

Thanks

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab Help

Loading...

Similar Threads for Matlab Help | Date |
---|---|

MATLAB MATLab: Not enough inputs for nlinfit | Nov 16, 2017 |

MATLAB Help needed to fix a matlab code | Nov 8, 2017 |

New to Matlab, help with vectors | Feb 20, 2016 |

Need help with integral | Dec 23, 2015 |

MATLAB 2D diffusion equation, need help for matlab code. | Nov 7, 2015 |

**Physics Forums - The Fusion of Science and Community**