Code covered by the BSD License  

Highlights from
PLOT_GAUSSIAN_ELLIPSOID

4.375

4.4 | 8 ratings Rate this file 81 Downloads (last 30 days) File Size: 2.6 KB File ID: #16543
image thumbnail

PLOT_GAUSSIAN_ELLIPSOID

by

 

23 Sep 2007 (Updated )

Plots two- and three-dimensional Gaussian distributions

| Watch this File

File Information
Description

PLOT_GAUSSIAN_ELLIPSOIDS plots 2-d and 3-d Gaussian distributions.
 
H = PLOT_GAUSSIAN_ELLIPSOIDS(M, C) plots the distribution specified by mean M and covariance C. The distribution is plotted as an ellipse (in 2-d) or an ellipsoid (in 3-d). By default, the distributions are plotted in the current axes. H is the graphics handle to the plotted ellipse or ellipsoid.
 
PLOT_GAUSSIAN_ELLIPSOIDS(M, C, SD) uses SD as the standard deviation along the major and minor axes (larger SD => larger ellipse). By default, SD = 1.
   
PLOT_GAUSSIAN_ELLIPSOIDS(M, C, SD, NPTS) plots the ellipse or ellipsoid with a resolution of NPTS (ellipsoids are generated on an NPTS x NPTS mesh). By default, NPTS = 50 for ellipses, and 20 for ellipsoids.
 
PLOT_GAUSSIAN_ELLIPSOIDS(M, C, SD, NPTS, AX) adds the plot to the axes specified by the axis handle AX.

MATLAB release MATLAB 7 (R14)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
13 Apr 2014 Sultan Alzahrani

Great job... I used it in my project and gave you a credit!

10 Jan 2014 jon erickson

works great and excellent documentation. thanks!

03 Jun 2011 Alex

Thanks for this one!! Works great.

02 Apr 2009 Fejjro

Simply spectacular! Using a sphere is a good idea.

26 Feb 2009 Andrew Callender  
12 Oct 2007 J Ugander

gca problem fixed, does what it says, well.

24 Sep 2007 John D'Errico

There is no need to move the help. It is in an entirely appropriate place.

I'll add a couple of minor comments. A standard style in matlab for functions that return graphics handles is not to return the handle if no output argument is supplied. See any function like plot, surf, etc. So why not check to see if there are any output arguments requested? If there are none, then do not return h. Thus add this test at the end of your file:

if nargout == 0
clear h
end

It was also unclear what the "number of points" means in the ellipsoid case. Is this the number of longitudinal lines?

Good help otherwise, good error checks, H1 line, examples, etc.

24 Sep 2007 Gautam Vallabha

"Put the help above the function, otherwise help cannot be displayed.". The help location in the m-file (below the function definition line) is a MathWorks convention. In any case, 'help plot_gaussian_ellipsoid' should work for all recent versions of MATLAB.

24 Sep 2007 Ram Acharya

Put the help above the function, otherwise help cannot be displayed.

Contact us