How to get a UI to capture start and end date from user.

조회 수: 3 (최근 30일)
sc1991
sc1991 2018년 7월 24일
댓글: Adam Danz 2018년 7월 27일
Hi! I am using questdlg to ask user if he wants to use default date range or a custom date range. If the user selects Custom date range. I want to pop up a UI that can in the same window have two calendars to capture start and end date. Also, i want the figure to have a editable box where if the user wants he can manually enter the date or else click on calendar. and if the user by accident clicks close it takes the default date range option from the questdlq case.
Please, let me know if my question is not very clear.
I am using MATLAB 2017(a)
Thanks
  댓글 수: 5
sc1991
sc1991 2018년 7월 27일
Ok I got most of My GUI I just need help with one more thing to complete the GUI. So I am using GUIDE, and i want it to give output which i am able to get from the OutputFcn callback but i also have a OK button in my GUI and that OK button is supposed to close the GUI for which I am using delete(handles.figure1). Now it does close the figure for me but as its deleting the figure it will even remove varargout output from my outputFcn. can any one help me how can i combat this.
This is my code for getting output and the OK button
function varargout = DateSelectorGUI_SPC_OutputFcn(hObject, eventdata, handles)
% Get default command line output from handles structure
varargout{1} = get(handles.edit1,'String');
varargout{2} = get(handles.edit2,'String');
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
delete(handles.figure1)
Adam Danz
Adam Danz 2018년 7월 27일
All functions stored in your GUI script created by GUIDE will be deleted along with your GUI when you close the GUI. If your goal is to make the GUI disappear but keep the functions and variables, maybe you could toggle the GUI's visibility instead of closing it.

댓글을 달려면 로그인하십시오.

답변 (1개)

ES
ES 2018년 7월 25일
Try this.. https://undocumentedmatlab.com/blog/date-selection-components

카테고리

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