How to have multiple lines in a table variable name?
48 views (last 30 days)
Show older comments
Dominik Mattioli
on 21 Jul 2021
Edited: Dominik Mattioli
on 21 Jul 2021
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 Comments
Accepted Answer
Sean de Wolski
on 21 Jul 2021
t = table(1,'VariableNames',"hello"+newline+"world")
t(1, "hello"+newline+"world")
Not sure why you'd want this though?
2 Comments
Walter Roberson
on 21 Jul 2021
It is not possible with any built-in functionality in any released version.
More Answers (0)
See Also
Categories
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!