Histogram part of data in matrix

Hello, I would like to see a histogram of a data that stored in 2d matrix that is >0.1. how can I do that? For example in matrix A=[1,2,3;4,5,6]. I want to histogram only data >3. any help will be appreciated.

 Akzeptierte Antwort

Image Analyst
Image Analyst am 14 Mär. 2012

0 Stimmen

Try this:
m = 10*rand(100,1);
[counts, bins] = hist(m(m>3), 50);
bar(bins, counts);
xlim([0 10]);
grid on;

3 Kommentare

KaMu
KaMu am 14 Mär. 2012
Thanks thats really helps, but I do have a lot of data and bars might not convenient. can i show these data on lines (like the one on the histogram?)
Image Analyst
Image Analyst am 15 Mär. 2012
You can use a line plot with plot() instead of bars with bar() if you want.
KaMu
KaMu am 16 Mär. 2012
Thanks .

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by