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?

 Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 15 Juin 2012

0 votes

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

Plus de réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by