Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: cell multiplication

$
0
0


"hala " <halagamal2009@gmail.com> wrote in message
news:km6k6h$h7o$1@newscl01ah.mathworks.com...
> i have problem in cell multiplication:
>
> wT=cell(1,26);
> for k=1:26
> wT{k}=zeros(1,145);
> y=zeros(26,1);
> end
>
> and i make some operations on it then when i multiply it with image 'i
> transfromed it to 145*1'
>
> [row,col]=size(testedImage);
> testedImage=reshape(testedImage,(row*col),1);
> testedImage(145,:)=1;
> for i=1:26
> y(i,1) = wT{i}*testedImage;
>
> end i got this error:
> Undefined function or method 'mtimes' for input arguments of type 'cell'

Matrix multiplication is not defined for cell arrays. You will need to
multiply 2D matrices.

My suspicion is that you're writing wT(i) instead of wT{i} on the line in
the loop or that you've assigned a cell array to one of the cells inside wT
(so you have a cell inside a cell.)

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

Viewing all articles
Browse latest Browse all 19628

Trending Articles