我的功能是:
function [tout, yout] = Lorenz (rho, x0)
%define constants
sigma = 10;
beta = 8/3;
%initial conditions
y0 = [x0; 1; 0];
f = @(t, y) [sigma*(y(2)-y(1)); (y(1)*(rho-y(3)))-y(2); (y(1)*y(2)) - (beta*y(3))];
[tout, yout] = ode45(f, [0 100], y0, 'RelTol', 1e-6, 'AbsTol', 1e-8);
end
当我在命令窗口中运行该函数时
Lorenz(14,0)
我回来
Error using Lorenz>@(t,y)[sigma*(y(2)-y(1));(y(1)*(rho-y(3)))-y(2);(y(1)*y(2))-(beta*y(3))]
Too many input arguments.
任何帮助将非常感激。