フィルターのクリア

I need to find the length of an array for values > 0

2 ビュー (過去 30 日間)
Cameron Bowyer
Cameron Bowyer 2021 年 9 月 12 日
回答済み: Chunru 2021 年 9 月 12 日
my array (called data) has values of 0 in it. I want to find the length of my array, exluding the 0 values.

採用された回答

Chunru
Chunru 2021 年 9 月 12 日
a = [1 2 0 3 -1 2 0];
n = sum(a~=0)
n = 5

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by