How to set names to column vectors?

조회 수: 6 (최근 30일)
Tony Castillo
Tony Castillo 2016년 10월 10일
댓글: George 2016년 10월 10일
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에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by