📄 ex5_4.m
字号:
% EX5_4.M Solve symbolically the second order equation% D2y+b*Dy+c*y=0 and plot for b=1, b=3 with c=1.% sym('b')y = dsolve('D2y+b*Dy+1*y=0','y(0)=1','Dy(0)=0','t');y=simple(y) % Simplify the solution% Substitute values b=1 and b=3clf % Clear any figures andhold on % plot multiple graphsezplot(subs(y,'b',3.0),[0,10])gtext('b=3') % Annotate text with mouseezplot(subs(y,'b',1.0),[0,10])gtext('b=1') title('Solution to D2y+b*Dy+y=0, y(0)=1,Dy(0)=0')ylabel('y(t)')gridhold off % Default setting%% Make this script more general; i.e. plot arbitrary % values of b and different ranges of t%% Version 5 Add sym and modify call to subs
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -