Code covered by the BSD License  

Highlights from
rhist

4.0

4.0 | 4 ratings Rate this file 19 Downloads (last 30 days) File Size: 2.1 KB File ID: #7880
image thumbnail

rhist

by Durga Lal Shrestha

 

20 Jun 2005 (Updated 22 Jun 2005)

Computes and plots relative frequency and relative frequency density.

| Watch this File

File Information
Description

rhist is extension of MATLAB hist function to compute and plot relative frequency and density.

N = HIST(Y) bins the elements of Y into 10 equally spaced containers and returns the relative frequency of elements in each container. If Y is a
matrix, RHIST works down the columns.

N = RHIST(Y,M), where M is a scalar, uses M bins.

N = RHIST(Y,X), where X is a vector, returns the relative freqency of Y among bins with centers specified by X. The first bin includes data between -inf and the first center and the last bin includes data between the last bin and inf.

N = RHIST(Y,M,Any_Character) returns relative frequency density of Y among bins.Any_Character is the any character inside single quotation or any numeric value. You can omit second optional argument using single quotation i.e. N = RHIST(Y,'',Any_Character) returns relative frequency density for 10 bins.

It is to be noted that sum(N)equals unity for relative frequency while area under curve for relative frequency density equals unity. Note that as size(Y,1) and M increases relative frequency density is close to probability density for continous random variable.

[N,X] = RHIST(...) also returns the position of the bin centers in X.

RHIST(...) without output arguments produces a histogram of relative frequency or relative frequency densisty.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
13 Sep 2005 Tim Pleskac  
18 Jul 2006 Umberto .

Produces and error on line 46, since the axescheck function is unspecified

17 Jan 2007 Adam A

Does what is says

16 May 2008 Jose V

Excellent.
Don“t forget the ', it works only in columns.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Durga Lal Shrestha 22 Oct 2008 07:50:51
probability Durga Lal Shrestha 22 Oct 2008 07:50:51
histogram Durga Lal Shrestha 22 Oct 2008 07:50:52
relative frequency Durga Lal Shrestha 22 Oct 2008 07:50:52
density Durga Lal Shrestha 22 Oct 2008 07:50:52

Contact us at files@mathworks.com