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!