If you can draw a circle using rectangle function, why would you need a circle function?
The code below plots a circle centered at (x,y), with a radius r, using the rectangle function,
x = 0.5; y = 0.5; r = 0.5;
rectangle('position', [x-r,y-r, 2*r, 2*r], 'Curvature', [1 1]);
The neat thing about using the rectangle function is that you don't need to decide on a 'sampling rate'. The sampling rate is needed if you actually write a function that computes the samples on the circle and plot them as line objects.
very helpful
ReplyDelete