How to call specific numbers from a matrix?

7 次查看(过去 30 天)
I have a matrix that is 100x3, each row of the matrix represents the percentage material in a soil sample, so each row adds up to 100% with the first column being percentage of sand, second column being percentage of silt, and third being the percentage of clay. This is a problem for a geology class.
I need to know what is command to tell me how many rows in the first column are greater than 50? A similar problem, is how do I do the same thing for more than one column say for example I want to know how many row have greater than 30 in the second column and 25 in the third?
Any help is appreciated.

采纳的回答

Fangjun Jiang
Fangjun Jiang 2016-10-13
a=rand(100,3)
A=sum(a(:,1)>0.5)
B=sum(a(:,2)>0.3 & a(:,3)>0.2)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Geology 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by