how to take all non zero elements product of matrix

7 Ansichten (letzte 30 Tage)
Jay Hanuman
Jay Hanuman am 9 Nov. 2016
Bearbeitet: KSSV am 9 Nov. 2016
how to do.

Antworten (1)

KSSV
KSSV am 9 Nov. 2016
Bearbeitet: KSSV am 9 Nov. 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.

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by