Plot markers around the perimeter of a shape

3 ビュー (過去 30 日間)
Nina
Nina 2013 年 2 月 13 日
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.

採用された回答

Thorsten
Thorsten 2013 年 2 月 13 日
編集済み: Thorsten 2013 年 2 月 13 日
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 件)

Community Treasure Hunt

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

Start Hunting!

Translated by