Call first row from zero-padded matrix - only call the non-zero values

1 回表示 (過去 30 日間)
BOB
BOB 2018 年 10 月 8 日
編集済み: KSSV 2018 年 10 月 8 日
Hi folks,
I have a zero-padded matrix. I'm aware A(:,1) would call the first row of matrix A, but I want to only call the values in each row with non-zero values.
Thanks

採用された回答

KSSV
KSSV 2018 年 10 月 8 日
編集済み: KSSV 2018 年 10 月 8 日
Note that A(:,1), calls the first column..not the first row. If you want first row, use A(1,:)
To get only non-zero values use:
r1 = A(1,A(1,:)~=0)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeElementary Math についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by