필터 지우기
필터 지우기

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 CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by