필터 지우기
필터 지우기

i am solving a ode

조회 수: 1 (최근 30일)
Arslan Ahmad
Arslan Ahmad 2017년 4월 19일
댓글: Arslan Ahmad 2017년 4월 19일
syms y(t);
ode = diff(y,t) == (1-y)*exp(-0.1*y)
ysol(t) = dsolve(ode)
cond = y(0) == .5;
ysol(t) = dsolve(ode,cond)
t=[0:5]
plot(t,ysol(t))
and error came
Error using plot Conversion to double from sym is not possible.
Error in q1 (line 7) plot(t,ysol(t))
kindly help me solve the problem

채택된 답변

KSSV
KSSV 2017년 4월 19일
doc double. You need to convert your sym class into double to plot here. In the present code, the following works.
plot(t,cell2mat(double(ysol(t))))
I suggest you to check your code once again.
  댓글 수: 1
Arslan Ahmad
Arslan Ahmad 2017년 4월 19일
Thanks a lot dear friend it worked.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D Function Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by