Date and time range picker from user
조회 수: 18 (최근 30일)
이전 댓글 표시
Hi all,
I'm writing a script (not with App designer) and I want to creating a gui where it is asked to insert beginning and ending date ("dd-MM-yyyy") and time ("hh:mm") of a specific event (like collection of blank data).
I like a lot the uidatepicker and I'd like to use an interface like that one.
So I wrote this:
fig = uifigure('Position',[500 500 375 280]);
dstart = uidatepicker(fig,'Position',[18 225 150 22]);
dend = uidatepicker(fig,'Position',[18 200 150 22]);
But:
- I don't know how to ask for the time too;
- I don't know how to "record" the data and to use them (like with the "timerange" function) since I don't understand when dstart.Value actually write the data: is there a way to create a button like "ok" or "acquire" in order to write the input?
- I don't know which would be the command to close the gui
Thank you for your reply.
Luca
댓글 수: 0
답변 (1개)
Rik
2023년 5월 23일
You might be interested in this example. You can easilly create an 'ok' button that will retrieve the set dates and times and closes the GUI.
Either close(fig) or delete(fig) will close the uifigure.
Note that you should consider using functions instead of script for anything you plan on using after next week. Functions provide an interface you can document and have their own workspace which is independent from the rest of the environment.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dialog Boxes에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!