strvcat doen not work.
2 ビュー (過去 30 日間)
古いコメントを表示
Dear all, I need to generate some box plots. However, there are several long texts and I need to break in vertical lines. I am using the command strvcat and am not having success. The following is an example of my script:
X = rand(20,6);
boxplot(X);
str={strvcat('cos(x)','Line 2'), strvcat('cos(x)','Line 2'), strvcat('cos(x)','Line 2'),...
strvcat('cos(x)','Line 2'), strvcat('cos(x)','Line 2'),strvcat('cos(x)','Line 2')};
set(gca, 'XTick',1:6,'XTickLabel',str, 'FontSize',8,'FontWeight','bold')
Can I help me? Thanks a lot!
1 件のコメント
Stephen23
2017 年 6 月 13 日
編集済み: Stephen23
2017 年 6 月 13 日
>> str{1}
ans =
cos(x)
Line 2
>> size(str{1})
ans =
2 6
Of course you should not be using strvcat anyway, as the documentation clearly states: "*Note:* strvcat is not recommended. Use char instead."
The real topic is that you apparently want multiple lines in the XTickLabels, something that is MATLAB version dependent. So if you actually read the help for your installed MATLAB version then you wold learn if newlines are supported in your MATLAB, and how. If you want us to help you, then please tell us in a comment: what version of MATLAB are you using?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Text Files についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!