ode45 in GUI
이전 댓글 표시
Hi I am new to GUI and I want to solve odes in the GUI. But now there are some errors.
function dhdt = toSolve(t,y)
dhdt(1) = 5;
dhdt(2) = 3;
dhdt = dhdt';
end
function Button_2Pushed(app, event)
[app.t, app.height_Tank1] = ode45(@toSolve,[0 20],[1; 3]);
plot(app.UIAxes3, app.t, app.height_Tank1(:,1));
app.UIAxes3.XLim = [0 20];
app.UIAxes3.YLim = [-3 3];
plot(app.UIAxes4, app.t, app.height_Tank1(:,2));
app.UIAxes4.XLim = [0 20];
app.UIAxes4.YLim = [-3 3];
end
I wanted the second function to make use of the first function, vdp to solve ode. I realize that vdp could not be handled(referenced? not sure about the wording). The error message is "Undefined function 'toSolve.vdp' for input arguments of type 'double'.
Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);"
Could anyone help me with it? Thanks a lot!
댓글 수: 1
Walter Roberson
2017년 8월 16일
? I do not see any vdp in the code ?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!