save the date by gui
2 次查看(过去 30 天)
显示 更早的评论
Hi guys I used the command uicalendar to determine the date but I want to save this date in variable ... I used this
a = uicalendar
but it doesn't save the date in variable a its just gave the properties..
0 个评论
采纳的回答
Jan
2017-5-2
编辑:Jan
2017-5-2
Did you read the documentation of uicalendar? See the example: You have to create a text uicontrol at first. The contents of the text field is set to the selected date directly.
To store the output in a variable, you need a wrapper function, which creates the text field at first and removes it afterwards:
FigH = figure('visible', 'off')
TextH = uicontrol(FigH, 'Style', 'text');
CalH = uicalendar('DestinationUI', {TextH, 'String'});
uiwait(CalH);
Date = get(TextH, 'String')
delete(FigH);
Does this work? I do not have the Financial Toolbox, therefore I cannot test this.
Alternatively, you can use a date picker from the FileExchange, e.g. the nice FEX: uigetdate or FEX: calendargui.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calendar 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!