Matlab : divide cell the same way as matrix

조회 수: 9 (최근 30일)
Maxime Hery
Maxime Hery 2015년 5월 12일
댓글: Maxime Hery 2015년 5월 12일
Hi everyone,
I would like to know why I have differences between a division with cells and with matrix.
For example :
A=rand(3,3); B=rand(3,3);
A1=mat2cell(A,[1 1 1],[1 1 1]);
B1=mat2cell(B,[1 1 1],[1 1 1]);
If I do A/B, I don't have the same result as :
cellfun(@rdivide,A1,B1)
My question is quite simple, why ? and is it possible to obtain the same result ?
Thanks for your advides :)

채택된 답변

Adam
Adam 2015년 5월 12일
편집: Adam 2015년 5월 12일
A/B
is matrix division.
rdivide is the equivalent of pointwise division given by A./B.
Since cellfun works per cell I would not think you can use it as an equivalent for matrix division.
  댓글 수: 1
Maxime Hery
Maxime Hery 2015년 5월 12일
Thank you for your fast answer.
Now that you mention it, I feel stupid ^^ and I don't think there is a way to make a matrix division without using cell2mat :S
Thank you again :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by