hi lets say i have an array 4x5 and it is compossed of 0's and 1's
as so a=[ 1 0 1 0 1;
1 1 0 1 1;
0 1 0 1 0;
1 0 1 0 1;]
and i want to count the zeros in each collumn
so im writing count(a,0) but i am getting erros ive read the material but dont understand what the string array means

 채택된 답변

Walter Roberson
Walter Roberson 2019년 10월 9일

0 개 추천

sum(a == 0, 1)
count() is primarily a method for processing string() datatype.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2019년 10월 9일

답변:

2019년 10월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by