Delete value of cell array and shift without just clearing it.
Show older comments
Hi. I have a cell array containing strings that looks something like this:
A = {'A'; 'B'; 'C'; 'D'; '1000'; 'E'; 'F'; 'G'; '1000'; 'H'}
I would like to delete the values '1000' and shift the other cells up one. When I do it using a for loop with an if condition in it, as in
When I code as I would with matrices, I get a cell array like this:
A = {'A'; 'B'; 'C'; 'D'; []; 'E'; 'F'; 'G'; []; 'H'}
but I need one like this:
A = {'A'; 'B'; 'C'; 'D'; 'E'; 'F'; 'G'; 'H'}
as would happen with a matrix.
Thanks in advance for any tips!
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!