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

2 visualizzazioni (ultimi 30 giorni)
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 Commenti
sc1991
sc1991 il 27 Lug 2018
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 il 27 Lug 2018
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.

Accedi per commentare.

Risposte (1)

ES
ES il 25 Lug 2018
Try this.. https://undocumentedmatlab.com/blog/date-selection-components

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by