finding the columns include ones

1 visualizzazione (ultimi 30 giorni)
sermet
sermet il 6 Gen 2024
Risposto: madhan ravi il 6 Gen 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?

Risposta accettata

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

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by