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

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com