how to extend a cell array?
Show older comments
i have a 1D cell array . i wish to increase its size by adding zeros to its right . i think i can use pad array with LOC as 'b' but i dont know the synax. help me with this please.
Accepted Answer
More Answers (2)
>> ca{1} = 'abc'
>> ca(2:15) = {0}; % put whatever value you want in this scalar cell
Just one line of code and no loops are required to extend a cell array. Note that that curly brackets and parentheses are deliberate!
Categories
Find more on Characters and Strings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!