must return a column vector

조회 수: 8 (최근 30일)
Taorui Wang
Taorui Wang 2019년 5월 3일
댓글: Taorui Wang 2019년 5월 3일
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일
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개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by