How do i create a header-cell array with many values??
10 次查看(过去 30 天)
显示 更早的评论
Hello everyone, I'm trying to create a cell array containing 1025 headers. Is there any way to do this with a for loop or something. Notice that every header must have a different name. For example i want to create this:
header = {'psb_1', 'psb_2',.......,'psb_1025'}
How can i do this except for doing it manually??
0 个评论
采纳的回答
Guillaume
2014-11-27
With your particular example:
numheaders = 1025;
header = arrayfun(@(n) sprintf('psb_%d', n), 1:numheaders, 'UniformOutput', false);
2 个评论
Image Analyst
2014-11-27
Please go ahead and Vote for it and mark it as Accepted to give Guillaume "reputation points."
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!