MATLAB Answers

How to create a circle with segments of specific colors

13 ビュー (過去 30 日間)
Ole
Ole 2019 年 3 月 3 日
Edited: Image Analyst 2019 年 3 月 3 日
I am trying to create an image of a circle with inner and outer radius, that is divided radially in segments. Then I would like to fill the segments with four solid colors (r b y m) that will repeat around the segments with theta. Ideally each different collor segment will subtend different angle.
rInner = 180; % inner radius of the colour ring
rOuter = 200; % outer radius of the colour ring
ncols = 20; % number of colour segments
[x, y] = meshgrid(-rOuter:1:rOuter);
[theta, rho] = cart2pol(x, y);
Here is an example the circle, it should close but it was bad choice of the angles.
test-01.jpg

  2 件のコメント

Rik
Rik 2019 年 3 月 3 日
Can you make a small example in paint of what you mean?
Image Analyst
Image Analyst 2019 年 3 月 3 日
And you can't adapt my answer below to do that?

サインイン to comment.

件の回答 (1)

Image Analyst
Image Analyst 2019 年 3 月 3 日
See attached demo and adapt as needed.
0000 Screenshot.png

  0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。

タグ

製品


リリース

R2016a

Translated by