Function Error
显示 更早的评论
When I input my very simple code, i get this:
function dx = lotka_volterra(t, x)
dx = [0; 0];
alpha = 1;
beta = .05;
delta = .02;
gamma = .5;
dx(1) = alpha * x(1) - beta * x(1) * x(2);
dx(2) = delta * x(1) * x(2) - gamma * x(2);
options = odeset('RelTol', 1e-4, 'NonNegative', [1 2]);
[t,x] = ode45('lotka_volterra', [0 20], [10 10], options);
plot(t,x);
??? function dx = lotka_volterra(t, x)
|
Error: Function definitions are not permitted in this context.
Not sure what this means, and I read other posts, but they were not helpful.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Gamma Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!