필터 지우기
필터 지우기

how to take all non zero elements product of matrix

조회 수: 2 (최근 30일)
Jay Hanuman
Jay Hanuman 2016년 11월 9일
편집: KSSV 2016년 11월 9일
how to do.

답변 (1개)

KSSV
KSSV 2016년 11월 9일
편집: KSSV 2016년 11월 9일
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.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by