Question in creating variables.
2 次查看(过去 30 天)
显示 更早的评论
How do i create variables in each iteration? like x_1 to x_n and then assigning values/arrays to each of them.
采纳的回答
Matt J
2012-9-30
I would do something like this:
labels=arrayfun(@(i) ['A' num2str(i)], 1:3,'uni',0).';
data=cellfun(@(a) num2str(a), num2cell(A),'uni',0);
result=[labels, data]
result =
'A1' '3' '5' '6'
'A2' '5' '3' '4'
'A3' '6' '7' '9'
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!