1
提問 -Matlab中的常微分方程
我正在研究解決2個一階微分和2個二階微分的一些matlab代碼。我確定dsolve(),但是當我想繪製我目前正在使用ezplot,它並沒有給我我想要的。我想用四個圖形產生一個窗口。我知道我會使用副劇,但我不知道如何,一個例子會很好。另外,我不知道如何讓我的地塊不僅僅是一個大面積的重要區域。我的代碼如下:
close all % close all figure windows that are open
clear all % clear all the variables currently stored in memory
clc % clear the commands in the command window
%%Problem 1%%%%%
a = (dsolve('Dv = -500*v+5000','v(0)=5'));
display (a)
b = (dsolve('Dx = -2000*x+100','x(0)=-.02'));
display (b)
%%Problem 2%%%%%
c = (dsolve('D2y+2000*Dy+26000000*y-520000000=0','Dy(0)=0','y(0)=5'));
display(c)
d = (dsolve('D2y+100*Dy+2500*y-520000000=0','Dy(0)=20','y(0)=0'));
display (d)
figure
ezplot(a);
axis([0,.01,4,10])
figure
ezplot(b);
axis([0,.01,0,10])
figure
ezplot(c);
axis([0,.01,4,10])
figure
ezplot(d);
axis([0,.01,4,10])
謝謝你這個工作,我其實需要放大這些「有趣的部分」,但我有一個好主意該怎麼做。感謝您的幫助 – user2444074
更新:我開始嘗試改變軸的值,如上所述,我記得命令軸緊;這解決了圖問題中「有趣」的部分。 – user2444074