How to plot this differential equation
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi guys, I hope you can help me to plot this differential equation:
Y = diff(X,tau); eq = (1-alpha)/(1 - gamma*(Y - Vdr)) + alpha + beta*(Y - Vdr)^2 == F
cond = [X(0) == 0, Y(0) == 0, Vdr == 2, alpha == 0.2, beta == 0, gamma == 3]; sol = dsolve (eq,cond)
Also Y = diff(X,tau) has to be less than Vdr.
I'm completely new using matlab, so I tried to write
fplot(@(tau)sol(tau), [-5 5], '-o')
But I only got a warning message: Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to return an output with the same size and shape as the input arguments.
Thanks
댓글 수: 0
답변 (1개)
Kim Winter
2018년 7월 3일
Hi, You have "tau" as an input, but never initialize it before the @fplot. For example, if you try to run just line 1 (Y=diff(X,tau);), you will get the error that X is uninitialized (although tau is not either). If you initialize your inputs, you may have a better result!
-Kim
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!