I'm trying to calculate the derivative of a an edit text box (edit1) and display the answer in a static text box (text1). But it is just displaying numbers. What am I doing wrong?
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, 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)
x=-10:.1:10;
equation = get(handles.edit1, 'String');
y = eval(equation);
derive_func = diff(y);
set(handles.text1, 'String', derive_func);
plot(y);
GUI Image - As you can see, it plots the function, but returns with 3 lines of numbers when it tries to differentiate: