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 CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by