Date and time range picker from user
26 ビュー (過去 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 で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!