finding the columns include ones

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?

 Respuesta aceptada

madhan ravi
madhan ravi el 6 de En. de 2024
index = find(all(matrix)) % one can directly use logical indexing without find() function

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 6 de En. de 2024

Respondida:

el 6 de En. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by