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:
Cell array of strings with a space...

Subject: Cell array of strings with a space...

From: Camille Couzi

Date: 27 Oct, 2010 19:41:05

Message: 1 of 3

Hi, I am trying to put dates into an uitable:

My dates have this format:
a=datestr(fecha,'dd-mm-yyyy HH:MM'), so there is a space between the date and the hour...

As in the uitable we can only put cell arrays, I have been converting my dates in cell arrays:
b=cellstr(a)

when I launch matlab, I get this error:

??? The following error occurred converting from cell to double:
Error using ==> double
Conversion to double from cell is not possible.

Apparently uitables don't like a lot the spaces in their cellarrays...
How can I solve this problem?

Any help would be great.
Thanks in advance!

Subject: Cell array of strings with a space...

From: Jan Simon

Date: 28 Oct, 2010 15:33:04

Message: 2 of 3

Dear Camille,

> a=datestr(fecha,'dd-mm-yyyy HH:MM'), so there is a space between the date and the hour...
>
> As in the uitable we can only put cell arrays, I have been converting my dates in cell arrays:
> b=cellstr(a)
>
> when I launch matlab, I get this error:
>
> ??? The following error occurred converting from cell to double:
> Error using ==> double
> Conversion to double from cell is not possible.
>
> Apparently uitables don't like a lot the spaces in their cellarrays...

In which line does the error occur?
Let Matlab stop when n error occurs:
  dbstop if error
and then inspect the variables of this line.

Jan

Subject: Cell array of strings with a space...

From: Camille Couzi

Date: 28 Oct, 2010 16:08:04

Message: 3 of 3

I Jan
thanks to reply to my message

I just solved my problem 2 seconds agooo!!!!!!!!
There was a problem in the order of the commands, I was making a bad mix between cell, num, str,cat, char... :-)

Thanks a lot

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