creating a cell with serial names
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I want to create a list (1x15 cell) of 15 names (sometimes more than that) with names of following pattern;
AB_01, AB_02, AB_03,....AB_15.
Is there an easy way to do this , in a loop like, rather than type it each.
Thanks
0 个评论
采纳的回答
Akira Agata
2019-6-18
How about the following?
suffix = repmat({'AB_'},15,1);
number = cellstr(num2str((1:15)','%02d'));
output = strcat(suffix,number)';
3 个评论
Stephen23
2019-6-20
darshani Thotagamuwage's incorrectly accepted "Answer" moved here:
It worked very well. Thanks a lot
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!