Borrar filtros
Borrar filtros

how to take all non zero elements product of matrix

2 visualizaciones (últimos 30 días)
Jay Hanuman
Jay Hanuman el 9 de Nov. de 2016
Editada: KSSV el 9 de Nov. de 2016
how to do.

Respuestas (1)

KSSV
KSSV el 9 de Nov. de 2016
Editada: KSSV el 9 de Nov. de 2016
Let A me your matrix or array.
idx = A~=0;
iwant=prod(A(idx));
idx should be an array. If not change A matrix to column using
A=A(:);
And then use the above code.

Categorías

Más información sobre Matrices and 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!

Translated by