I was drawing a vector field using phaplane, but I cannot draw any specific solution curve
>> g = @(t,Y) [Y(2), -Y(1)]
>> phaseplane(g, [-10,10], [-10,10], 25)
>> hold on
>> drawphase(g, 50, 3, 4)
Error using odearguments (line 93)
@(T,Y)[Y(2),-Y(1)] must return a column vector.
Error in ode45 (line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in drawphase (line 20)
[ts,ys] = ode45(g,[0,tmax],[y1start;y2start]);

 채택된 답변

Walter Roberson
Walter Roberson 2019년 5월 3일

1 개 추천

g = @(t,Y) [Y(2); -Y(1)];
Notice the ; instead of ,

댓글 수: 1

Taorui Wang
Taorui Wang 2019년 5월 3일
Cannt believe i made such a silly mistake! Thank you for pointing that out and responding so quickly

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

질문:

2019년 5월 3일

댓글:

2019년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by