How to name structured variable with number that correspond to number of itteration?
1 次查看(过去 30 天)
显示 更早的评论
How do I name structured variable with number that correspond to itteration in a loop? For example
for l=1:5
for i=...
for j=...
S.l{i,j}=...
end
end
end
I want to have structured variable S with files 1,2,3,4,5 and inside each file to have cell. thanks!!
0 个评论
采纳的回答
Azzi Abdelmalek
2013-6-3
编辑:Azzi Abdelmalek
2013-6-3
You can not use a number as a field, try this
for l=1:5
for i=1:3
for j=1:4
S.(sprintf('f%d',l)){i,j}=rand
end
end
end
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assembly 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!