In GUIDE, How can I perform differentiation of a function input by the user?

1 view (last 30 days)
The following is how I get the function input by the user. I would like to add a push button on the GUIDE that can differentiate this function, and another push button to plot the differentiated function.
Thank you!
function y1_Callback(hObject, eventdata, handles) % hObject handle to y1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of y1 as text % str2double(get(hObject,'String')) returns contents of y1 as a double stringf=get(hObject,'String'); handles.stringf=stringf; guidata(hObject,handles); y1=@(x) eval(get(hObject,'String')); handles.y1=y1; guidata(hObject,handles);

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!