f



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

What does this error mean?
0
bobDizzle
8/30/2015 5:49:03 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

6 Replies
1694 Views

Similar Articles

[PageSpeed] 43

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
0
Nasser
8/30/2015 6:10:15 PM
On 08/30/2015 1:10 PM, Nasser M. Abbasi wrote:
> 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

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.

--
0
dpb
8/30/2015 6:58:11 PM
"dpb" wrote in message <mrvjkp$cm1$1@dont-email.me>...
> On 08/30/2015 1:10 PM, Nasser M. Abbasi wrote:
> > 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
> 
> 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.
> 
> --

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.
0
bobDizzle
8/31/2015 1:36:07 AM
"dpb" wrote in message <mrvjkp$cm1$1@dont-email.me>...
> On 08/30/2015 1:10 PM, Nasser M. Abbasi wrote:
> > 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
> 
> 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.
> 
> --

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.
0
bobDizzle
8/31/2015 1:36:07 AM
On 08/30/2015 8:36 PM, bobDizzle wrote:
> "dpb" wrote in message <mrvjkp$cm1$1@dont-email.me>...
>> On 08/30/2015 1:10 PM, Nasser M. Abbasi wrote:
>> > 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
>>
>> 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.
>>
>> --
>
> 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.

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.

--


0
dpb
8/31/2015 2:04:09 AM

"bobDizzle" <ryanmoudy13@yahoo.com> wrote in message 
news:ms0b27$hfa$1@newscl01ah.mathworks.com...
> "dpb" wrote in message <mrvjkp$cm1$1@dont-email.me>...
>> On 08/30/2015 1:10 PM, Nasser M. Abbasi wrote:
>> > 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
>>
>> 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.
>>
>> --
>
> 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.

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
slord@mathworks.com
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com 

0
Steven
8/31/2015 2:26:26 PM
Reply: