MATLAB Answers

Plot markers around the perimeter of a shape

11 views (last 30 days)
Nina
Nina on 13 Feb 2013
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.

  0 Comments

Sign in to comment.

Accepted Answer

Thorsten
Thorsten on 13 Feb 2013
Edited: Thorsten on 13 Feb 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.')

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by