painting specific points in sunflower stracture

5 次查看(过去 30 天)
Hi!
I have this sunflower structure and in need to paint one point in red and the neighbors in another color.
phi = (sqrt(5)-1)/2;
n = 500;
rho = (5:n-1).^phi;
theta = (5:n-1)*2*pi*phi;
polar(theta, rho, '.');
title([num2str(n) ' Sunflower Seeds']);
set(gcf, 'color', 'w');
How I can do it?
  5 个评论
Image Analyst
Image Analyst 2019-12-1
I was wondering that myself. Maybe he meant randi() to get the random index from the list of points he already has in (theta, rho) list of coordinates. Like
randomIndex = randi(length(theta), 1);
randomTheta = theta(randomIndex);
randomRho = rho(randomIndex);

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2019-11-28
Did you try plot(), something like
plot(x, y, 'r.', 'MarkerSize', 30);

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by