Effacer les filtres
Effacer les filtres

finding the columns include ones

2 vues (au cours des 30 derniers jours)
sermet le 6 Jan 2024
matrix=[1 0 0 1 0;0 1 0 1 0];
% I need to find the number of column includes [1;1]
index_1 = 4 ;
% how can I find this using code or function?

Réponse acceptée

madhan ravi
madhan ravi le 6 Jan 2024
index = find(all(matrix)) % one can directly use logical indexing without find() function

Plus de réponses (0)


En savoir plus sur Matrix Indexing dans Help Center et File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by