Plot markers around the perimeter of a shape

I have the perimeter of a tumour plotted over a dicom image (Drawn with impoly). I want to place a user inputted number of markers (I know how to get a user to input a number) equally spaced around this perimeter. An example to visualise it is perhaps like plotting north, east, south, west, etc. on a circle. I can't find a suitable function in the help so perhaps somebody on here has solved a similar problem.
If I could get a list of x, y coordinates in clockwise order around my shape I could then select an nth pair of coordinates to place a marker on eg. plot(x, y, 1:50:end)?
Thank you.

 Réponse acceptée

Thorsten
Thorsten le 13 Fév 2013
Modifié(e) : Thorsten le 13 Fév 2013
Draw sample contour (e.g, a circle)
th = linspace(0, 2*pi);
x = cos(th); y = sin(th);
plot(x, y, 'k-')
Draw N equally spaced points on the contour
N = 10;
ind = round(1:length(th)/N:length(th));
hold on
plot(x(ind), y(ind), 'r.')

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by