how to give title and axes in histfit?

5 ビュー (過去 30 日間)
ammu v
ammu v 2020 年 9 月 21 日
編集済み: Adam Danz 2020 年 9 月 21 日
subplot(1,2,1);
hn=histfit(cutven_values,'','kernel');set(hn(1),'facecolor','g','edgecolor','r');set(hn(2),'color','b');
grid on
xlabel('difference');
ylabel('count', 'FontSize', 15);
its showing error- Index exceeds the number of array elements (6), when I add xlabel,ylabel

採用された回答

Adam Danz
Adam Danz 2020 年 9 月 21 日
編集済み: Adam Danz 2020 年 9 月 21 日
You have a variable in your workspace named xlabel.
Rename that variable.
Example of this error:
xlabel = 'apples';
xlabel('difference')
% ERROR
% Index exceeds the number of array elements (6).
This because 'difference' is converted to a numeric matrix
double('difference')
ans =
100 105 102 102 101 114 101 110 99 101
And since your label only contains 6 characters, the error is caused by trying to access the 100th element.
xlabel = 'apples';
xlabel(100)
% ERROR
% Index exceeds the number of array elements (6).

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by