Matrix manipulation

3 次查看(过去 30 天)
Mate 2u
Mate 2u 2012-6-15
Hi everybody. I have a 2 x 10000 matrix.
I want a short code which can tell me exactly out of the 1000 are [1;1]s?

采纳的回答

Andrei Bobrov
Andrei Bobrov 2012-6-15
A - your matrix
out = sum(ismember(A.',[1 1],'rows')) > 1000;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by