>> [T,Y]=ode23('fun1',[0,6],0.2)
[T,Y]=ode23('fun1',[0,6],1.8)
T =
0
0.1000
0.6000
1.2000
1.6893
2.1758
2.7453
3.3453
3.9453
4.5453
5.1453
5.7453
6.0000
Y =
0.2000
0.2165
0.3129
0.4535
0.5751
0.6877
0.7956
0.8767
0.9286
0.9598
0.9777
0.9877
0.9904
T =
0
0.1000
0.2650
0.4642
0.7071
1.0065
1.3809
1.8592
2.4592
3.0592
3.6592
4.2592
4.8592
5.4592
6.0000
Y =
1.8000
1.6726
1.5170
1.3871
1.2799
1.1931
1.1249
1.0734
1.0385
1.0205
1.0111
1.0060
1.0032
1.0018
1.0010
>> function z=fun1(x,y)
z=y*(1-y);
??? function z=fun1(x,y)
|
Error: Function definitions are not permitted in this context.
>> [T,Y]=ode23('fun1',[0,6],0.2)
??? Error using ==> feval
Undefined function or method 'fun1' for input arguments of type 'double'.
Error in ==> odearguments at 109
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ==> ode23 at 172
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...