about use function ode45
조회 수: 5 (최근 30일)
이전 댓글 표시
I have written small program about ode45 my program is function z= func(t,y) z=t./y; ode45(f,[0 2],1)
and it did not run.
댓글 수: 0
답변 (1개)
Mischa Kim
2014년 12월 5일
Mary, use
function my_ode()
[T,Z] = ode45(@func,[0 2],1); % use correct name of ODE function
plot(T,Z)
end
function z = func(t,y)
z = t./y;
end
Copy-paste the code into a MATLAB function window and safe as my_ode.m.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!