When I run the example in the documentation for global variables given below (To bring up this documentation type
web([docroot,'/techdoc/matlab_prog/ch12_nd2.html#38052'])
on the MATLAB Command Prompt):
Create a file, lotka.m.
function yp = lotka(t,y)%LOTKA Lotka-Volterra predator-prey model.
global ALPHA BETAyp = [y(1) - ALPHA*y(1)*y(2); -y(2) + BETA*y(1)*y(2)];
Then interactively enter the statements
global ALPHA BETAALPHA = 0.01BETA = 0.02[t,y] = ode23('lotka',0,10,[1; 1]);plot(t,y)
I get the following warning:
Warning: Obsolete syntax. Use ode23(fun,tspan,y0,...) instead. > In funfun\private\odearguments at 41 In ode23 at 170
Best Answer