View License

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

» Watch video

Highlights from

3.5 | 2 ratings Rate this file 5 Downloads (last 30 days) File Size: 2.01 KB File ID: #4298 Version: 1.0



Alister Fong (view profile)


19 Dec 2003 (Updated )

Produces coordinates of a square for matrix usage.

| Watch this File

File Information

Given a center and a radius, this program produces the coordinates of a square whether hollow or solid. This program is especially useful for drawing squares around circles. The result is a set of coordinates that is suitable for use to produce the square shape on a matrix.

MATLAB release MATLAB 6.0 (R12)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
28 Sep 2012 Dimitris

Just adding that this works best if the radius and coordinates of the centre of the square are integers and big enough that the algorithm can do +1 and -1 increments to find the points. That is determined by the way you calculate the tempX and tempY matrices. Perhaps there could be an input to select how many points you want per side and then create the tempX and tempY matrices accordingly. Might make it... Thanks!

26 Jan 2007 Tyrone Jackson

OK, good job! Next!

Contact us