Mulitple Histogram plot with bars

I am trying to create two histograms on a plot. I tried this
[n, xout] = hist(data(1:179396,1));
bar(xout, n, 'barwidth', 1, 'basevalue', 1); hold;
Current plot held
[n2, xout2] = hist(data(1:179484,1));
bar(xout2, n2, 'barwidth', 1, 'basevalue', 1);
set(gca, 'XTick', 0:20:1000)
set(gca,'YScale','log')
and I got the "Index exceeds matrix dimensions" error.
I was wondering if anyone could help me. I know it should give that error. but I was wondering if there is a way to get around this.

3 件のコメント

Oleg Komarov
Oleg Komarov 2011 年 8 月 27 日
PLease format your code: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup#answer_18099
Anthony
Anthony 2011 年 8 月 27 日
thanks Oleg.
Chaowei Chen
Chaowei Chen 2011 年 8 月 27 日
I didn't get errors from your code! Hooray?

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

質問済み:

2011 年 8 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by