How do I make a table using fprintf?
显示 更早的评论
I need to make a 13x2 table from data in Matlab with titles. I wasn't shown how to do this and I can't find help online.
回答(1 个)
Star Strider
2014-10-16
This is one way:
x = randi(10,13,2); % Create Data
fprintf(1, ' Col#1 Col#2\n') % Column Titles
fprintf(1, '\t\t%2d\t\t%2d\n', x') % Write Rows
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!