Two questions about "hist" function - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Two questions about "hist" function

rnayebirnayebi Posts: 4Member
I have two questions about "hist". As you know, [n,xout] = hist(...) returns vectors n and xout containing the frequency counts and the bin locations.


a = [7 3 8 4 2 6 9 4 3];

[n,x] = hist(a,2);






Result:



n =

5 4



x =

3.7500 7.2500





1. How can I obtain the elements (or indexes of elements) which exist in the first interval or second interval? For instance, at the above example for first interval the elements {2,3,3,4,4} and for second interval the elements {6,7,8,9}.



2. How can I use the hist function when I have a Three dimensional vector (a matrix(3*3)) instead of a single dimensional vector?





Comments

Sign In or Register to comment.