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:
variable conversions

Subject: variable conversions

From: Jessica

Date: 9 Jul, 2010 19:31:04

Message: 1 of 3

I have variables called ExcelFile2. For example,

ExcelFile2 = 01_3-30-10_120035

whos ExcelFile2
  Name Size Bytes Class Attributes

  ExcelFile2 1x17 34 char

I want to loop through a series of these files and see whether they match or don't match clips. For example, the clips I have might be:

Clip={'01_3-30-10_120035'; '01_3-30-10_97319'};

I tried to set-up a comparison, but it didn't work:

if ExcelFile2 == Clip(1)
end;

but I get the error:

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

Any suggestions for making this work so that it returns either a 1 (yes, it's a complete match) or 0 (no, it's not a complete match)?

Thanks!

Subject: variable conversions

From: Walter Roberson

Date: 9 Jul, 2010 19:30:55

Message: 2 of 3

Jessica wrote:
> I have variables called ExcelFile2. For example,
> ExcelFile2 = 01_3-30-10_120035
>
> whos ExcelFile2
> Name Size Bytes Class Attributes
>
> ExcelFile2 1x17 34 char
> I want to loop through a series of these files and see whether they
> match or don't match clips. For example, the clips I have might be:
>
> Clip={'01_3-30-10_120035'; '01_3-30-10_97319'};
>
> I tried to set-up a comparison, but it didn't work:
>
> if ExcelFile2 == Clip(1)
> end;
>
> but I get the error:
>
> ??? Undefined function or method 'eq' for input arguments of type 'cell'.
>
> Any suggestions for making this work so that it returns either a 1 (yes,
> it's a complete match) or 0 (no, it's not a complete match)?
>
> Thanks!

if strcmp(ExcelFile2, Clip{1})

However you should consider ismember()

Subject: variable conversions

From: Jessica

Date: 9 Jul, 2010 21:22:04

Message: 3 of 3

Walter Roberson <roberson@hushmail.com> wrote in message <i17tjb$qri$1@canopus.cc.umanitoba.ca>...
> Jessica wrote:
> > I have variables called ExcelFile2. For example,
> > ExcelFile2 = 01_3-30-10_120035
> >
> > whos ExcelFile2
> > Name Size Bytes Class Attributes
> >
> > ExcelFile2 1x17 34 char
> > I want to loop through a series of these files and see whether they
> > match or don't match clips. For example, the clips I have might be:
> >
> > Clip={'01_3-30-10_120035'; '01_3-30-10_97319'};
> >
> > I tried to set-up a comparison, but it didn't work:
> >
> > if ExcelFile2 == Clip(1)
> > end;
> >
> > but I get the error:
> >
> > ??? Undefined function or method 'eq' for input arguments of type 'cell'.
> >
> > Any suggestions for making this work so that it returns either a 1 (yes,
> > it's a complete match) or 0 (no, it's not a complete match)?
> >
> > Thanks!
>
> if strcmp(ExcelFile2, Clip{1})
>
> However you should consider ismember()

Thanks, this was a big 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