Clearing part of an array
Mostrar comentarios más antiguos
I'm having a tough time figuring out the syntax to access specific columns in an array (and maybe even using the wrong terms to describe this...).
Say data=1x16 cell. If I want to clear the data but keep the columns intact, I have been doing data{1,8}={} and that clears column 1-8. However, I can not do data{9,16}={} to clear 9-16.
How would I do this? I'm sure it's something simple I am overlooking...
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 29 de En. de 2013
Editada: Image Analyst
el 29 de En. de 2013
0 votos
You must be doing 1:8, not 1 comma 8. {9,16} would refer to a single cell of a 2D cell array (the cell in the 9th row and 16th column of the 2D cell array), which you don't have - you have only a 1D cell array. To clear cells 9 through 16 use colon like 9:16.
Categorías
Más información sobre Logical 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!