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:
different data types

Subject: different data types

From: Jessica

Date: 18 Jun, 2008 19:17:02

Message: 1 of 3

I have a column of mixed data in an excel sheet that
appears as the following in Matlab:

PolygonROI =

    'PolygonROI'
    [ -1]
    [ -1]
    '1,3,4'
    '1,3,4'



I am trying to paste in certain cells of 'PolygonROI' into
an empty variable. I tried to create an array:

a=zeros(5,1);

and then put certain values of 'PolygonROI' inside a given
cell:

a(2,1) = PolygonROI(4)

with the hope of outputing:

a=
0
0
0
'1,3,4'
0

However, it didn't output this because it said "Conversion
to double from cell is not possible."

Does anyone have any suggestions?

Thanks!!

Subject: different data types

From: French Caro

Date: 18 Jun, 2008 19:25:03

Message: 2 of 3

"Jessica " <jyorzinski@ucdavis.edu> wrote in message
<g3bmvd$rfk$1@fred.mathworks.com>...
> I have a column of mixed data in an excel sheet that
> appears as the following in Matlab:
>
> PolygonROI =
>
> 'PolygonROI'
> [ -1]
> [ -1]
> '1,3,4'
> '1,3,4'
>
>
>
> I am trying to paste in certain cells of 'PolygonROI' into
> an empty variable. I tried to create an array:
>
> a=zeros(5,1);
>
> and then put certain values of 'PolygonROI' inside a given
> cell:
>
> a(2,1) = PolygonROI(4)
>
> with the hope of outputing:
>
> a=
> 0
> 0
> 0
> '1,3,4'
> 0
>
> However, it didn't output this because it said "Conversion
> to double from cell is not possible."
>
> Does anyone have any suggestions?
>
> Thanks!!
>
>
>
Hi
PolygonROI is a cell array (see help on cell)
So you can do :
a=cell(5,1)
a{4}=PolygonROI{4};

Caroline

Subject: different data types

From: Jessica

Date: 18 Jun, 2008 19:52:02

Message: 3 of 3

"French Caro " <caro95470@nospam.free.fr> wrote in message
<g3bnef$3a2$1@fred.mathworks.com>...
> "Jessica " <jyorzinski@ucdavis.edu> wrote in message
> <g3bmvd$rfk$1@fred.mathworks.com>...
> > I have a column of mixed data in an excel sheet that
> > appears as the following in Matlab:
> >
> > PolygonROI =
> >
> > 'PolygonROI'
> > [ -1]
> > [ -1]
> > '1,3,4'
> > '1,3,4'
> >
> >
> >
> > I am trying to paste in certain cells of 'PolygonROI'
into
> > an empty variable. I tried to create an array:
> >
> > a=zeros(5,1);
> >
> > and then put certain values of 'PolygonROI' inside a
given
> > cell:
> >
> > a(2,1) = PolygonROI(4)
> >
> > with the hope of outputing:
> >
> > a=
> > 0
> > 0
> > 0
> > '1,3,4'
> > 0
> >
> > However, it didn't output this because it
said "Conversion
> > to double from cell is not possible."
> >
> > Does anyone have any suggestions?
> >
> > Thanks!!
> >
> >
> >
> Hi
> PolygonROI is a cell array (see help on cell)
> So you can do :
> a=cell(5,1)
> a{4}=PolygonROI{4};
>
> Caroline


Thanks, that was a HUGE help!

Tags for this Thread

No tags are associated with 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