Azzera filtri
Azzera filtri

save the date by gui

2 visualizzazioni (ultimi 30 giorni)
Khaled Al-Faleh
Khaled Al-Faleh il 1 Mag 2017
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..

Risposta accettata

Jan
Jan il 2 Mag 2017
Modificato: Jan il 2 Mag 2017
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.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by