Create a character cell in ascending order
Show older comments
i want to create a cell of 1000*1 , containing the strings in ascending order.
Let's say variable1, variable2,....variable999,variable1000. How can i do that with for loop?
Accepted Answer
More Answers (1)
N = 1000;
C = cell(1,N);
for k = 1:N
C{k} = sprintf('variable%d',k);
end
Categories
Find more on Structures 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!