Code covered by the BSD License  

Highlights from
plot_square

3.5

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

plot_square

by

 

19 Dec 2003 (Updated )

Produces coordinates of a square for matrix usage.

| Watch this File

File Information
Description

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