Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- a=str2double(get(handles.editA,'String'));
- b=str2double(get(handles.editB,'String'));
- h=(b-a)/100;
- t=a:h:b;
- if get(handles.rbs,'Value') == 1
- plot(t, sin(t));
- elseif get(handles.rbc,'Value') == 1
- plot(t, cos(t));
- elseif get(handles.rbt,'Value') == 1
- plot(t, tan(t));
- elseif get(handles.rbsh,'Value') == 1
- plot(t, sinh(t));
- elseif get(handles.rbch,'Value') == 1
- plot(t, cosh(t));
- elseif get(handles.rbth,'Value') == 1
- plot(t, tanh(t));
- elseif get(handles.rbe,'Value') == 1
- plot(t, exp(t));
- elseif get(handles.rbln,'Value') == 1
- plot(t, log(t));
- end
- if get(handles.checkbox_x,'Value' )==1
- set(gca,'XGrid','on' );
- else
- set(gca,'XGrid','off' );
- end
- if get(handles.checkbox_y,'Value' )==1
- set(gca,'YGrid','on' );
- else
- set(gca,'YGrid','off');
- end
- % --- Executes on button press in checkbox_x.
- function checkbox_x_Callback(hObject, eventdata, handles)
- % hObject handle to checkbox_x (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- if get(hObject, 'Value') == 1
- set(gca, 'XGrid', 'on');
- else
- set(gca, 'XGrid', 'off');
- end
- % --- Executes on button press in checkbox_y.
- function checkbox_y_Callback(hObject, eventdata, handles)
- % hObject handle to checkbox_y (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- if get(hObject, 'Value') == 1
- set(gca, 'YGrid', 'on');
- else
- set(gca, 'YGrid', 'off');
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement