Symbolic Differentiation in GUIDE using MATLAB

1 回表示 (過去 30 日間)
Rahul
Rahul 2014 年 3 月 12 日
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?

回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by