Symbolic Differentiation in GUIDE using MATLAB

1 visualización (últimos 30 días)
Rahul
Rahul el 12 de Mzo. de 2014
I'm using GUIDE in MATLAB R2013b to make an application that takes an expression in a text box (edit1), and shows the derivate in a static text (text2). Here's my code:
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(~, ~, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
syms('x')
equation = get(handles.edit1, 'String');
y = eval(equation);
set(handles.text2, 'String', char(diff(y)));
It isn't working, however. I get the bell sound (in Windows 7) when the button is pressed. What's wrong?

Respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by