4.22222

4.2 | 9 ratings Rate this file 29 Downloads (last 30 days) File Size: 2.09 KB File ID: #13844
image thumbnail

Plot an ellipse in "center form"

by Nima Moshtagh

 

02 Feb 2007 (Updated 16 Nov 2007)

Draws 2D and 3D ellipses that are given in "center form".

| Watch this File

File Information
Description

Ellipse_plot(A,c)

This function draws an N-dimensional ellipse (N = 2,3) that is given in "center form":

(x - C)' A (x - C) <= 1

where C is the center of the ellipse, and A is an NxN positive definite symmetric matrix.

A and C could be the outputs of the function: "MinVolEllipse.m", which computes the minimum volume enclosing ellipsoid containing a set of points in an N-dimensional space. For example, you can use this function as follows:

  P = rand(3,100);
  t = 0.001;
  [A , C] = MinVolEllipse(P, t)
  figure
  plot3(P(1,:),P(2,:),P(3,:),'*')
  hold on
  Ellipse_plot(A,C)

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Minimum Volume Enclosing Ellipsoid

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (14)
18 Mar 2007 John Huddleston

The ellipsoid.m function is missing

[X,Y,Z] = ellipsoid(0,0,0,a,b,c,N);

22 Mar 2007 nima moshtagh

Reply to John Huddleston's comment:

Function ellipsoid.m is an standard MATLAB command. It is included in version R13.

20 Oct 2007 Blake Richards

I found it quite easy to use and read.

08 Apr 2008 david torres

works like a charm

27 May 2008 Gergely Takacs

Exactly what I was searching for! Thanks!:)

04 Sep 2008 Santanu Ghorai

Earlier I was doing only maths! But this has given me the joy of visualization.

15 Feb 2009 Tony Mei

Terrific!
Well, good programs! However, Nima, could you please show me some reference link to the mathematical basis of your algorithm ? Thanks a lot.

18 Jun 2009 Nima Moshtagh

Here is a paper describing the "minimum volume enclosing ellipse" algorithm and the math behind the code: http://www.seas.upenn.edu/~nima/papers/Mim_vol_ellipse.pdf

17 Jul 2010 Bismark Nkansah

Good work, Nima. I've been trying to follow the link to study the mathematical basis for the algoritm, but without success. Could you please help me?
Is it possible that in determining the minimum volume we can assign weights to the points such that the farther away a point is from the main 'cloud' the smaller its weight?
Thanks a lot.

17 Aug 2010 Nima Moshtagh

Here is a link to the (unpublished) paper describing the algorithm and math behind the code:

https://sites.google.com/site/nimamoshtagh/software/MVEE.pdf?attredirects=0

14 Dec 2010 Jimmy

Error appears when I use your function.
I found that there is another ellipsoid.m in my external toolbox.
Maybe this ellipsoid.m is called instead of that in Matlab.
So, how to solve this problem?

20 Aug 2011 LIAO xj  
06 Sep 2011 Ahmed Fasih

To plot just circles with "r" radius, pass in eye(2)*(r)^-2 as the covariance matrix. A plot function like this shouldn't change the plot more than it needs to: I disabled the "grid" and "axis" commands. It should also return handles to the plot objects it creates: I had to add this as well. But this code gets me 95% there, thanks.

12 Oct 2011 Kwame

Can you please show me an example of the function inputs? I keep getting errors about my inputs.

Please login to add a comment or rating.
Updates
05 Feb 2007

Updated the input arguments of the function. Also, added some comments to the code.

21 Aug 2007

modifying the file name.

16 Nov 2007

The help section of the function was edited.

Tag Activity for this File
Tag Applied By Date/Time
specialized Nima Moshtagh 22 Oct 2008 08:59:18
plotting Nima Moshtagh 22 Oct 2008 08:59:18
plot Nima Moshtagh 22 Oct 2008 08:59:18
ellipse Nima Moshtagh 22 Oct 2008 08:59:18
ellipsoid Nima Moshtagh 22 Oct 2008 08:59:18
minimum volume ellipse Nima Moshtagh 22 Oct 2008 08:59:18

Contact us at files@mathworks.com