Delete rows from cell array in a for loop
Mostrar comentarios más antiguos
Hi, I want to delete one row in each iteration in a for loop. For example in iteration 1 I want to delete row 1, in iteration 2 I want to delete row 2 but I want to have row 1 in my cell array, in iteration 3 I want to delete row 3 but I want to have row 2 and 3 in my cell array. How can I do it?
Respuesta aceptada
Más respuestas (1)
David Hill
el 24 de Oct. de 2022
for k=1:100
a=yourCell;%just copy yourCell to another variable
a(k,:)=[];%deletes row k
end
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!