Create row with text from loop for a table
1 次查看(过去 30 天)
显示 更早的评论
I want to create a table with a row like this:
[Bar No.1; Bar No.2 ... Bar No.n]
I tried it with:
%N = 4x6;
capa = zeros(size(N,1),1);
i=1;
while i<= size(N,1)
capa(i) = sprintf('Capa #%d',i);
i=i+1;
end
I tried also with fprintf, but it doesn't work.
My table has other information which I want to add this column as first:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/294202/image.png)
0 个评论
采纳的回答
Stijn Haenen
2020-5-19
you can create table headers with:
a=table();
for i=1:10;
a.(sprintf('bar %g',i))=i;
end
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!