How to have multiple lines in a table variable name?

37 ビュー (過去 30 日間)
Dominik Mattioli
Dominik Mattioli 2021 年 7 月 21 日
コメント済み: Steven Lord 2024 年 2 月 7 日
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' } )

採用された回答

Sean de Wolski
Sean de Wolski 2021 年 7 月 21 日
t = table(1,'VariableNames',"hello"+newline+"world")
t = table
hello↵world ___________ 1
t(1, "hello"+newline+"world")
ans = table
hello↵world ___________ 1
Not sure why you'd want this though?
  4 件のコメント
Dominik Cisar
Dominik Cisar 2024 年 2 月 7 日
Could be very helpful for me as well. Are there any plans to add this feature?
Thanks
Steven Lord
Steven Lord 2024 年 2 月 7 日
Generally we don't comment on whether or not there are plans to implement any feature.
But this does seem like a reasonable enhancement request. Please contact Technical Support directly using this link and ask them to add this to the enhancement request database. When you ask this of Support, please share with them how you would use this functionality if it existed. There may be an alternate solution they could offer that might not be exactly what you want but may be "good enough" for your purposes, or if there isn't your use case could be helpful when the developers are reviewing the enhancement request.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by