Gui: equation solving calculator

조회 수: 14 (최근 30일)
Misha Brown
Misha Brown 2020년 6월 6일
댓글: David Hill 2020년 6월 6일
Hi, I’m making an application that will be able to solve equations using the solve function, but I get an error when trying to calculate equations like x-4, what’s wrong, tell me please
Error in
matlab.graphics.internal.figfi le.FigFile/read>@(hObject,eventdata)super _program('pushbutton5_Callback ',hObject,eventdata,guidata(hO bject))
Error while evaluating UIControl Callback.
function pushbutton5_Callback(hObject, eventdata, handles)
eqn = get(handles.edit1);
X = solve(eqn);
set(handles.edit1,'string',X);

답변 (1개)

David Hill
David Hill 2020년 6월 6일
Not sure if this will help.
eqn ='a*x^2+b*x+c';
var = symvar(eqn);
for k=1:length(var)
syms(var{k});
end
EQN=eval(eqn)==0;
X=solve(EQN,x);
  댓글 수: 2
Misha Brown
Misha Brown 2020년 6월 6일
did not help(
David Hill
David Hill 2020년 6월 6일
When you get(handles.edit1), is it a character array or string?

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

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by