how to take all non zero elements product of matrix

5 ビュー (過去 30 日間)
Jay Hanuman
Jay Hanuman 2016 年 11 月 9 日
編集済み: KSSV 2016 年 11 月 9 日
how to do.
  1 件のコメント
jupiter
jupiter 2016 年 11 月 9 日
What is the format of the data?

サインインしてコメントする。

回答 (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 Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by