How to set names to column vectors?

6 次查看(过去 30 天)
Hi my friends, how to set name to columns vectors?, for instance these? disp(C) 15.5528 601.4385 11.8749 129.4530 13.2851 270.5859 9.9169 3.4992 20.6769 936.8461 12.1105 436.2808 16.3999 768.1774

采纳的回答

George
George 2016-10-10
If you want to associate a variable name with a piece of data I think your best bet is to use a table instead.
If you just want to display formatted text you can use sprintf().
  4 个评论
Guillaume
Guillaume 2016-10-10
编辑:Guillaume 2016-10-10
The correct syntax to convert a matrix into a table is:
A = array2table(myMatrix, 'VariableNames', {'Temp', 'Irr'});
The table constructor expects one input per column, not a matrix of columns. The above will result in an error.
George
George 2016-10-10
Oops, that's correct. Good catch. I was recalling that he had said column vectors.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by