Creating a logical array within a loop
Mostrar comentarios más antiguos
I am trying to create a logical array in a loop, wherein each iteration of the loop should create a new column in my array:
for i= 1:size(Behaviours) %Behaviours is a 27x1 cell array containing strings
temp = strcmp(Shank2_KOs(k).BehaviourType, Behaviours(i)); %creates the logical vectors
temp_array = temp(:,i);
end
2 comentarios
Rik
el 16 de Abr. de 2020
You are overwriting both variables every iteration. What do you want to store in which variable?
Amy Hassett
el 16 de Abr. de 2020
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!