Function definitions are not permitted in this context.
a = 0.5;B = 0.6;k = 1; [t, x] = ode45(@Ray, [0 30],[ 0 0.1], [], a, B, k); plot(x(:,1), x(:,2), 'k-') function d = Ray(t, y, a, B, k)d=[y(2);-k*y(1)+a*y(2)-B*y(2^3];
function definitions are not permitted in this context.
a = 0.5;B = 0.6;k = 1; [t, x] = ode45(@Ray, [0 30],[ 0 0.1], [], a, B, k); plot(x(:,1), x(:,2), 'k-') function d = Ray(t, y, a, B, k)d=[y(2);-k*y(1)+a*y(2)-B*y(2^3];
Best Answer