Matlab : divide cell the same way as matrix

9 visualizaciones (últimos 30 días)
Maxime Hery
Maxime Hery el 12 de Mayo de 2015
Comentada: Maxime Hery el 12 de Mayo de 2015
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 :)

Respuesta aceptada

Adam
Adam el 12 de Mayo de 2015
Editada: Adam el 12 de Mayo de 2015
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 comentario
Maxime Hery
Maxime Hery el 12 de Mayo de 2015
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 :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by