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:
Undefined function 'le' for input arguments of type 'cell'.

Subject: Undefined function 'le' for input arguments of type 'cell'.

From: Bryan

Date: 5 Jul, 2013 16:32:10

Message: 1 of 2

Hey Everyone,

I'm writing a script to take a vector of data (a) and compare it with a vector of truth data (b). The function should result in a vector of the absolute difference between 'a' and the value it's closest to in 'b' and a vector of the closest value of 'b' to each value of 'a'. When I run the function I'm receiving the error:

Undefined function 'le' for input arguments of type 'cell'.

I know this has been an issue for people using the less than or equal to operator if they try to compare cell data, but I'm referencing an index of a cell so I don't see the issue. If anyone could help it would be appreciated!

This is the line of code it's complaining about:

if a(j) <= b(k)

j and k are counters that reference the index of the vector and have starting values of
j=1;
k=1;

Also note that the data of vector a is in scientific notation for some reason. I don't know if that would make a difference since b is floating point.

Subject: Undefined function 'le' for input arguments of type 'cell'.

From: Sadik

Date: 6 Jul, 2013 17:22:10

Message: 2 of 2

Hi Bryan,

You should use curly braces as in

if a{j} <= b{k}

Best.

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