Conversion operators error!
6 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to set my xTicklabels:
set(gca, 'xtick',1:8,'XTickLabels',compose('diffNA2l','diffNA2h','diffA2l','diffA2h','allNA2h','allNA2l','allA2l','allA2h'))
it is giving me
Error using compose (line 98)
Format must have enough conversion operators for the data arguments.
Why?
0 件のコメント
採用された回答
Scott MacKenzie
2021 年 5 月 6 日
You don't need compose because you aren't formatting numeric values into the labels. Just specifiy your labels in a cell array:
bar(1:8, rand(1,8));
labels = {'diffNA2l','diffNA2h','diffA2l','diffA2h','allNA2h','allNA2l','allA2l','allA2h'};
set(gca, 'xtick', 1:8, 'XTickLabels', labels);
2 件のコメント
Image Analyst
2021 年 5 月 6 日
Or you could use the separate functions made for dealing with tick marks (R2016b and later):
xticks()
xticklabels()
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!