Cell Array and Matrix
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
RoboKid
el 10 de Nov. de 2013
Editada: per isakson
el 17 de Mayo de 2015
How do I multiply/subtract a cell array and a matrix for Ex. I want to multiply D and L , Cell array
D = {[1 2] , [1 1] ; [1 6 ] , [5 2] };
and matrix
L=[1 0 0 0; 0 1 0 0 ]
1 comentario
Azzi Abdelmalek
el 10 de Nov. de 2013
Editada: Azzi Abdelmalek
el 10 de Nov. de 2013
What is the expected result? There are several possibilities
Respuesta aceptada
Azzi Abdelmalek
el 10 de Nov. de 2013
Editada: Azzi Abdelmalek
el 10 de Nov. de 2013
One of the possibilities
D = {[1 2],[1 1] ;[1 6 ],[5 2]}
L=[1 0 0 0; 0 1 0 0 ];
out=cellfun(@(x) x*L,D,'un',0)
%or maybe
cell2mat(D).*L
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Multidimensional Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!