|
>> fun=inline('y-2*x./y','x','y');
>> [x,y]=ode45(fun,[0 1],1);[x',y']
ans =
Columns 1 through 8
0 0.0250 0.0500 0.0750 0.1000 0.1250 0.1500 0.1750
Columns 9 through 16
0.2000 0.2250 0.2500 0.2750 0.3000 0.3250 0.3500 0.3750
Columns 17 through 24
0.4000 0.4250 0.4500 0.4750 0.5000 0.5250 0.5500 0.5750
Columns 25 through 32
0.6000 0.6250 0.6500 0.6750 0.7000 0.7250 0.7500 0.7750
Columns 33 through 40
0.8000 0.8250 0.8500 0.8750 0.9000 0.9250 0.9500 0.9750
Columns 41 through 48
1.0000 1.0000 1.0247 1.0488 1.0724 1.0954 1.1180 1.1402
Columns 49 through 56
1.1619 1.1832 1.2042 1.2247 1.2450 1.2649 1.2845 1.3038
Columns 57 through 64
1.3229 1.3416 1.3601 1.3784 1.3964 1.4142 1.4318 1.4491
Columns 65 through 72
1.4663 1.4832 1.5000 1.5166 1.5330 1.5492 1.5652 1.5811
Columns 73 through 80
1.5969 1.6125 1.6279 1.6432 1.6583 1.6733 1.6882 1.7029
Columns 81 through 82
1.7176 1.7321
要是想画图,用下面的命令:
plot(x,y) |
|