Gui: equation solving calculator

6 visualizaciones (últimos 30 días)
Misha Brown
Misha Brown el 6 de Jun. de 2020
Comentada: David Hill el 6 de Jun. de 2020
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);

Respuestas (1)

David Hill
David Hill el 6 de Jun. de 2020
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 comentarios
Misha Brown
Misha Brown el 6 de Jun. de 2020
did not help(
David Hill
David Hill el 6 de Jun. de 2020
When you get(handles.edit1), is it a character array or string?

Iniciar sesión para comentar.

Categorías

Más información sobre Programming en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by