Symbolic Differentiation in GUIDE using MATLAB

1 visualizzazione (ultimi 30 giorni)
Rahul
Rahul il 12 Mar 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?

Risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by