How to plot Euler's method and ODE45 against eachother?
显示 更早的评论
N0=5 %Euler method
r=10
tmax=10
dt=0.1
[T,N]=expgrowthEULER(N0,tmax,dt,r)
a=[T,N]
tspan=[0,10] %numerical integration
Y0=5
r=10
[T,Y]=ode45(@(T,Y) expgrowthODE(T,Y,r),tspan,Y0)
b=[T,Y]
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!