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

4 次查看(过去 30 天)
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