Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Undefined operator '/' for input arguments of type 'cell'." Error?

1,167 views
Skip to first unread message

bobDizzle

unread,
Aug 30, 2015, 1:49:08 PM8/30/15
to
What does this error mean?

Nasser M. Abbasi

unread,
Aug 30, 2015, 2:10:21 PM8/30/15
to
On 8/30/2015 12:49 PM, bobDizzle wrote:
> What does this error mean?
>

You seem to have used {} to build your matrix or vectors.

use [] instead of {} and try again

dpb

unread,
Aug 30, 2015, 2:58:16 PM8/30/15
to
or, dereference cell array contents with {}.
The precise solution would depend on the context

The answer to the question is that you're trying to operate on a cell
array with an expression only valid for numeric values.

--

bobDizzle

unread,
Aug 30, 2015, 9:36:13 PM8/30/15
to
"dpb" wrote in message <mrvjkp$cm1$1...@dont-email.me>...
I am using {} to reference a cell array that I am building on the fly. It is a numeric value that I am trying to store in the array. I have tried ". / " if that is what you are thinking (without the space). What I am actually doing is taking data off webpage, doing mulitplication/division and storing it into an array. It just won't except the mathematics.

This should be very simple, as in:

Y=a/b*10^3.

i.e. Where a =1 and b =2.

bobDizzle

unread,
Aug 30, 2015, 9:36:13 PM8/30/15
to
"dpb" wrote in message <mrvjkp$cm1$1...@dont-email.me>...

dpb

unread,
Aug 30, 2015, 10:04:16 PM8/30/15
to
As said, _MUST_ see the precise code and error _in context_ to tell but
clearly the code you're actually executing is operating on a cell (and
guessing, probably a string) instead of an actual numeric expression,
but we can't see that from here...

We need the actual code and the data representation as given by, say,

whos

for the variables in the subject expression.

--


Steven Lord

unread,
Aug 31, 2015, 10:26:32 AM8/31/15
to


"bobDizzle" <ryanm...@yahoo.com> wrote in message
news:ms0b27$hfa$1...@newscl01ah.mathworks.com...
From the fact that you're receiving this error, that's NOT what a and b
contain. Either a = {1} or b = {2} or both. [Actually, given that you're
extracting data from a web page, I think it likely that A is {'1'} and B is
{'2'}. That adds just one more wrinkle.]

A cell array can contain ANY data; numeric, character, logical, even other
cells or structs. The various cells in a cell array can even contain
different data types:

A = {magic(7), dir, {ones(3)}}
class(A{1})
class(A{2})
class(A{3})
class(A{3}{1})

This is one of the reasons none of the arithmetic operators (including
division) are defined for cells.

--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Andrei

unread,
Mar 18, 2017, 6:50:07 PM3/18/17
to
"Steven Lord" <Steve...@mathworks.com> wrote in message <ms1o6i$n32$1...@newscl01ah.mathworks.com>...
How about FINTS objects ... we know a fints only has numerical values so comparisons should be more than possible, instead I get:

>> dt(dt.Close > 1,:)
Undefined operator '>' for input arguments of type 'fints'.
0 new messages