Find the total number of values between alimits
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a matrix A= [1,2,3,4,5,6,7,8,9,10,11]. I would like to find out total number of elements which are greater that 3 and less than 10. expected answer is no of values between 3 &10 is= 6.
I have used formulae no of values =sum(A(:) == 3<A<10)); but it showing error.
댓글 수: 0
채택된 답변
Michael Haderlein
2015년 5월 7일
you were close:
>> A= [1,2,3,4,5,6,7,8,9,10,11];
>> sum(A>3 & A<10)
ans =
6
댓글 수: 0
추가 답변 (1개)
Purushottama Rao
2015년 5월 7일
sum(3<A)-sum(A>=10)
USE THIS
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!