Matrix manipulation

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일

0 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by