سلام
من معادلات لوتکا ولترا و یا همان شکار و شکارچی رو نمی تونم تو متلب بنویسم و رسم کنم حتی مثالی که از خود help متلب کپی می کنم باز هم error می گیرم لطفا راهنماییم کنید.
برنامه ی خود help به صورت زیر هست:
کد پیاچپی:
function yp = lotka (t,y)
%LOTKA Lotka-Volterra predator-prey model.
% Copyright 1984-2002 The MathWorks, Inc.
% $Revision: 5.7 $ $Date: 2002/04/15 03:33:21 $
yp = diag [(1 - .01*y(2))*y(1), (-1 + .02*y(1))*y(2)];
% Define initial conditions.
t0 = 0;
tfinal = 15;
y0 = [20 20];
% Simulate the differential equation.
tfinal = tfinal*(1+eps);
[t,y] = ode23('lotka',[t0 tfinal],y0);
subplot(1,2,1)
plot(t,y)
title('Time history')
subplot(1,2,2)
plot(y(:,1),y(:,2))
title('Phase plane plot')