Combine logical arrays into one array

118 visualizaciones (últimos 30 días)
DavidL88
DavidL88 el 7 de Abr. de 2021
Comentada: DavidL88 el 7 de Abr. de 2021
I have 4 '24871x1 logical' called L1, L2, L3, L4. I want to combine these into one 24871x1 logical array. In any given row only one of the four arrays will have a 1. I want the output array to have a 1 if there's a 1 in any row of L1-4 and 0 if all rows are 0 in L1-4. Can anyone advise how I do this?

Respuesta aceptada

James Tursa
James Tursa el 7 de Abr. de 2021
L = L1 | L2 | L3 | L4;

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by