Hi, I have created a calendar in MATLAB GUI. I thought it was automatically change the date itself according to the computer calendar. However, everytime I opened my GUI it still gave the same time that i created it. How can I make the adjustment so it display the correct date.

 Réponse acceptée

Matt Fig
Matt Fig le 25 Avr 2011

0 votes

In the code you must have put in a hard value for the date. Instead, use the DATE function.
str = date;
figure('numbert','off','name',str)
You didn't mention where the date was displayed, but I show it on the titlebar of the figure above. You should also consult the help for DATE, and DATESTR. DATESTR can be used with the NOW function to get the date format you like.

4 commentaires

MrPuzzled Marc
MrPuzzled Marc le 25 Avr 2011
It is displayed inside MATLAB GUI, i create a calendar using the Activex control. However, I understood that time should be following the computer date. However, everytime i opened the gui the date is still fixed. How to make it run automatically the date?
Matt Fig
Matt Fig le 25 Avr 2011
There are myriad ways of making a calendar with ActiveX. What program are you using as the server for the ActiveX control? You will need to be a lot more specific to get to the solution...
MrPuzzled Marc
MrPuzzled Marc le 27 Avr 2011
I create the calendar using the ActiveX control button , inside there is a MSCalendar to choose. I have used handles.activex=date however this do not return the current date. Still stagnant to the date I created it.
MrPuzzled Marc
MrPuzzled Marc le 27 Avr 2011
I create the calendar using the ActiveX control button , inside there is a MSCalendar to choose. I have used handles.activex=date however this do not return the current date. Still stagnant to the date I created it.

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by