How to have multiple lines in a table variable name?
조회 수: 71(최근 30일)
표시 이전 댓글
Can you change the interpreter of the table to format variable names? Both of these examples fail to accomplish the goal:
% Example 1: sprintf().
varName = { sprintf( 'A multi-\nline name' ) };
t = table( 'Size', horzcat( 1, 1 ), 'VariableNames', varName, 'VariableTypes', { 'double' } )
% Example 2: multi-line char array.
varName = char( 'A multi-', 'line name' );
t = table( 'Size', horzcat( 1, 1 ), 'VariableNames', varName, 'VariableTypes', { 'double' } )
댓글 수: 0
채택된 답변
Sean de Wolski
2021년 7월 21일
t = table(1,'VariableNames',"hello"+newline+"world")
t(1, "hello"+newline+"world")
Not sure why you'd want this though?
댓글 수: 2
Walter Roberson
2021년 7월 21일
It is not possible with any built-in functionality in any released version.
추가 답변(0개)
참고 항목
범주
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!