clear all
function dydt=f(t,y)
f1=y(2)
f2=sin(w(2)*t)-2*w(1)*y(1)-3*y(2)
fun=inline('[f1;f2]','t','y','flag','w');
x=[2 2;3 3;9 9;4 4;8 8;7 7;2 2;1 1;6 6;9 9;];
tsp=[0 10];
y0=[1 1 ];
for i=1:10
[t,y]=ode45(fun,tsp,y0,[],x(i,:));
plot(t,y)
end
提示是??? Error: File: jifen2.m Line: 2 Column: 1
Function definitions are not permitted at the prompt or in scripts