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
Walter Roberson 2017년 8월 16일
? I do not see any vdp in the code ?

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

답변 (0개)

카테고리

태그

질문:

2017년 8월 16일

댓글:

2017년 8월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by