Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
UICALENDAR

Subject: UICALENDAR

From: jothi

Date: 6 Oct, 2011 11:06:11

Message: 1 of 5

Dear Matlab users,

I designed a GUI to select a file using a date.The selection is using uicalendar.I given my command here.

uicalendar('DestinationUI', {handles.edit5 , 'string'});

when i run my code in matlab itself it's populating a graphics calendar and once i selected the date it's choosed the correct date file which date i selected.But,when i changed the GUI as a standalone application(.exe)while pressing the date selection push button it gives following error.How can i solve this issue?


??? Undefined function or method 'uicalendar' for input arguments of type 'cell'
.

Error in ==> TIDE>pushbutton1_Callback at 102

Error in ==> gui_mainfcn at 95

Error in ==> TIDE at 42

??? Error using ==> TIDE('pushbutton1_Callback',gcbo,[],guidata(gcbo))
Undefined function or method 'uicalendar' for input arguments of type 'cell'.

??? Error while evaluating uicontrol Callback


Thanks,
Jo.

Subject: UICALENDAR

From: audric

Date: 8 Nov, 2011 13:45:31

Message: 2 of 5

Hello,

I have the same problem. I know uicalendar is not supported by the compiler application so I am looking for an alternative which looks like more or less the same. Do you have any proposals?

Thanks in advance !

"jothi" wrote in message <j6k233$k6g$1@newscl01ah.mathworks.com>...
> Dear Matlab users,
>
> I designed a GUI to select a file using a date.The selection is using uicalendar.I given my command here.
>
> uicalendar('DestinationUI', {handles.edit5 , 'string'});
>
> when i run my code in matlab itself it's populating a graphics calendar and once i selected the date it's choosed the correct date file which date i selected.But,when i changed the GUI as a standalone application(.exe)while pressing the date selection push button it gives following error.How can i solve this issue?
>
>
> ??? Undefined function or method 'uicalendar' for input arguments of type 'cell'
> .
>
> Error in ==> TIDE>pushbutton1_Callback at 102
>
> Error in ==> gui_mainfcn at 95
>
> Error in ==> TIDE at 42
>
> ??? Error using ==> TIDE('pushbutton1_Callback',gcbo,[],guidata(gcbo))
> Undefined function or method 'uicalendar' for input arguments of type 'cell'.
>
> ??? Error while evaluating uicontrol Callback
>
>
> Thanks,
> Jo.

Subject: UICALENDAR

From: Yair Altman

Date: 8 Nov, 2011 20:35:28

Message: 3 of 5

"Audric" wrote in message <j9bbpr$9i7$1@newscl01ah.mathworks.com>...
> Hello,
>
> I have the same problem. I know uicalendar is not supported by the compiler application so I am looking for an alternative which looks like more or less the same. Do you have any proposals?
>
> Thanks in advance !

Of course:
http://UndocumentedMatlab.com/blog/date-selection-components

Yair Altman
http://UndocumentedMatlab.com

Subject: UICALENDAR

From: thalia

Date: 2 Jan, 2014 21:43:10

Message: 4 of 5

"jothi" wrote in message <j6k233$k6g$1@newscl01ah.mathworks.com>...
> Dear Matlab users,
>
> I designed a GUI to select a file using a date.The selection is using uicalendar.I given my command here.
>
> uicalendar('DestinationUI', {handles.edit5 , 'string'});
>
> when i run my code in matlab itself it's populating a graphics calendar and once i selected the date it's choosed the correct date file which date i selected.But,when i changed the GUI as a standalone application(.exe)while pressing the date selection push button it gives following error.How can i solve this issue?
>
>
> ??? Undefined function or method 'uicalendar' for input arguments of type 'cell'
> .
>
> Error in ==> TIDE>pushbutton1_Callback at 102
>
> Error in ==> gui_mainfcn at 95
>
> Error in ==> TIDE at 42
>
> ??? Error using ==> TIDE('pushbutton1_Callback',gcbo,[],guidata(gcbo))
> Undefined function or method 'uicalendar' for input arguments of type 'cell'.
>
> ??? Error while evaluating uicontrol Callback
>
>
> Thanks,
> Jo.




Had the same problem.
The trick is to use gco function.
In order to get selected date displayed on the button you press and pops up the calendar, I used

function pushbutton_select_date_Callback(hObject, eventdata, handles)
uicalendar('Weekend', [1 0 0 0 0 0 1], ...
'SelectionType', 1, 'DestinationUI', gco);

if you want the selected date to display in a different uicontrol (like a edit textbox) , just go to the uicontrol's callback and execute the following
global gco1
gco1 = gco;
Then go to the calendar's callback and change the respected value from gco->gco1 and declare the variable as global
global gco1
uicalendar('Weekend', [1 0 0 0 0 0 1], ...
'SelectionType', 1, 'DestinationUI', gco1);

Caution: the command is executed correctly only if the handle is NOT empty (handles = [] ) it must have a number assigned to it. Numbers change each time you execute the GUI

To check available handles any time, type "handles" at any function callbak

Note: instead of "gco" you can use the appropriate handle number in brackets.
ex. uicalendar('DestinationUI', [7.0952584000]);

 

Subject: UICALENDAR

From: Steven Lord

Date: 3 Jan, 2014 15:45:01

Message: 5 of 5


"thalia " <thalia2809@gmail.com> wrote in message
news:la4mhe$hva$1@newscl01ah.mathworks.com...

*snip*

> Note: instead of "gco" you can use the appropriate handle number in
> brackets.
> ex. uicalendar('DestinationUI', [7.0952584000]);

DO NOT DO THIS.

There's no guarantee that the handle value is the same from run to run, and
there's also no guarantee that the number you typed is exactly, down to the
last bit, equal to the actual handle. In general you should never treat the
handles as numbers (the _possible_ exception is figure handles, as by
default they are represented as integer values.)

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us