2つの行からなる凡例を使用してヒストグラムをプロットしようとしています。 次のコードを実行すると、エラーにつながる:ヒストグラムの凡例の複数の行
Error using matlab.graphics.chart.primitive.Histogram/set
Value cell array handle dimension must match handle vector length.
xErr = randn(1,1000);
[mu, sig] = normfit(xErr);
h = histogram(xErr, 100, 'Normalization','pdf');
% The following command causes the error
set(h_xErr, {'DisplayName'}, {['Standard deviation $\sigma_{x} = $ ', num2str(sigX)]; ['Mean $\mu_x = $ ', num2str(muX)]});
hl = legend('Location', 'NorthWest');
set(hl,'Interpreter','latex');
私もヒストグラムコマンドで直接DisplayNameプロパティを試みたが、これはどちらか動作しません。 this questionによれば、セルアレイの次元も、エラー状態もまたハンドルの数と一致することが必要である。
私は同じエラーで別のハンドルを追加することを考えました。
h = [h; histogram(xErr, 100, 'Normalization','pdf')];
ヒストグラムの凡例の2行を取得するための簡単な方法はありますか?
することは、私はMatlabのR2016b DisplayName
documentationパー