Creating a table with only headers
古いコメントを表示
I would like to create an empty table with the headers 'Observations', 'Mean', 'Treatment' and 'Residual'. I would also like the predetermine the amount of data to fit in the table, i.e., if I have two 2 sets, the table should allow for 2*4 inputs.
採用された回答
その他の回答 (1 件)
table has a preallocation syntax:
table('Size', [2 4], 'VariableNames', ["Observations", "Mean", "Treatment", "Residual"], 'VariableTypes', repmat("double", 1, 4))
2 件のコメント
Adam Danz
2021 年 11 月 16 日
Thanks Seth.
@Sebastian Daneli, this solution also allows you to set the variable types which is quite useful. This is the better answer.
Star Strider
2021 年 11 月 16 日
Duly noted! I completely forgot about 'Size'.
Thank you!
カテゴリ
ヘルプ センター および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!