Info
此问题已关闭。 请重新打开它进行编辑或回答。
Passing variable sized arguments to a method
1 次查看(过去 30 天)
显示 更早的评论
Hello
I'm using the PrintTable method of the matlabtools . In the documentation the following example is given:
t = PrintTable('LaTeX/PDF export demo, %s',datestr(now));
t.HasRowHeader = true;
t.HasHeader = true;
t.addRow('A','B','C');
Let's say I have the header names in a cell array `header = {'A','B','C'}`. Unfortunately a cell array cannot be passed to `addRow`, i.e. `t.addRow(header);` does not work. Unfortunately the size of the header varies in my case, that's why I'm storing it in a cell array.
How can I call the `addRow` method with a variable sized cell array?
1 个评论
回答(1 个)
Jan
2017-10-24
编辑:Jan
2017-10-24
I do not know this toolbox and installing it just to answer this question might be inefficient. Do I understand correctly, that
t.addRow('A','B','C');
works, but you have a cell array as input? Then this creates the comma separated list with a variable size of elements:
header = {'A','B','C'}
t.addRow(header{:});
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!