Filter löschen
Filter löschen

save the date by gui

2 Ansichten (letzte 30 Tage)
Khaled Al-Faleh
Khaled Al-Faleh am 1 Mai 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..

Akzeptierte Antwort

Jan
Jan am 2 Mai 2017
Bearbeitet: Jan am 2 Mai 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.
  1 Kommentar
Khaled Al-Faleh
Khaled Al-Faleh am 2 Mai 2017
yes its work sir Thanks alot

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by