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

조회 수: 8 (최근 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