spaces between columns, or, table format. How to assemble the table?

16 次查看(过去 30 天)
Well, I'm not a supporter of tables, only when I do exams. But please tell me how to format a table with several titles and columns, such as: Column 26 Column 43 Column 7. And below the row of titles, the values or the columns' numbers n * 1. It is because, for me, it's a bit difficult to understand, in the 'table help'. Thanks for your help. REGARDS

采纳的回答

Ameer Hamza
Ameer Hamza 2018-4-21

Yor can use the following command to create a table with m rows and n columns.

t = cell2table(cell(m, n));

You can specify the name of rows and columns of the table using t.Properties.RowNames and t.Properties.VariableNames respectively. For doing what you want, you can do it like this,

for i=1:length(q.Properties.VariableNames)
  q.Properties.VariableNames{i} = strcat('Column ', num2str(i));
end

It will name all columns as Column 1, column 2, ...., Column n.

  1 个评论
César Hernández
César Hernández 2018-4-22
Thank you very much; this answer seems interesting. I will review it as soon as possible, that is, before the end of this month, I hope. Any doubt I have, I consult you, if no problem.
Regards !!!.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by