View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
ellipseMatrix(y0, x0, a, b, theta, im, c1, c2, pInterp)

5.0 | 4 ratings Rate this file 8 Downloads (last 30 days) File Size: 1.48 KB File ID: #17499 Version: 1.3
image thumbnail

ellipseMatrix(y0, x0, a, b, theta, im, c1, c2, pInterp)


Nicolae Cindea (view profile)


13 Nov 2007 (Updated )

Drawing an ellipse into a matrix image.

| Watch this File

File Information

Set the elements of the matrix im which are in the interior of the
ellipse E to the value 'c1'. The ellipse E has center (y0, x0), the
major axis = a, the minor axis = b, and theta is the angle made by the
major axis with the orizontal axis.
ret = ellipseMatrix(y0, x0, a, b, theta, im, color)
ret is a matrix of the same size as the matrix im.
The input parameters c2 and pInterp are optional. If they are present
the ellipse will have a smoother border (of size pInterp pixels) with
variations of color between c1 and c2.
Function: ellipseMatrix
Version: 1.2
% October 14, 2014
% Author: Nicolae Cindea

MATLAB release MATLAB 7.13 (R2011b)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
05 Sep 2014 Henry Tsang

This code sets elements WITHIN the ellipse to value 'color'. Where can I modify it such that as long as the element touches (and need not be fully enclosed) by the ellipse to also set value to 'color'?

Comment only
27 Jun 2011 Athi

Athi (view profile)

20 Nov 2010 piao lin

very useful for me ´╝îThank you very much

14 Apr 2010 Gaurav Jain

Works well, Thank you for posting this.

Comment only
18 Jul 2009 Tony

Tony (view profile)

Very good ellipse function.

11 Dec 2007 Eric Dick

This is a great function for creating ellipses in an image matrix. Since circles are simplified ellipses it can be used to make those too. V1.1 puts a single pixel nerd on the NSEW ends for the circle (semimajor = semiminor) and for some ellipses.

14 Oct 2014 1.1

A simpler code and some new options.

14 Oct 2014 1.2

An example of utilisation is added.

14 Oct 2014 1.3

fixing some typos in the description

Contact us