File Exchange

image thumbnail

plot_square

version 1.0 (2.01 KB) by

Produces coordinates of a square for matrix usage.

0 Downloads

Updated

View License

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.

Comments and Ratings (2)

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!

Tyrone Jackson

OK, good job! Next!

MATLAB Release
MATLAB 6.0 (R12)

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

» Watch video

Win prizes and improve your MATLAB skills

Play today