?? predprey.m
字號:
function [out] = PredPrey(x, y, flag)%% Evaluate the right hand side function for the% Predator Prey model%% y_1'(x) = alpha*y_1(x) - beta*y_1(x)*y_2(x)% y_2'(x) = gamma*y_2(x) + delta*y_1(x)*y_2(x)%%%alpha = 0.25;beta = 0.01;gamma = -1.00;delta = 0.01;switch( flag ) case '' % return right hand side out = [ alpha*y(1)-beta*y(1)*y(2); gamma*y(2)+delta*y(1)*y(2) ]; case 'jacobian' % return Jacobian of right hand side out = [ alpha-beta*y(2) -beta*y(1); delta*y(2) gamma+delta*y(1)]; otherwise error(['Unknown request.'])end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -