How can i divide a circle into 12 parts? 6 sectors having 15 degrees and the rest 6 having 30 degrees?

4 ビュー (過去 30 日間)
How can i divide a circle into 12 parts? 6 sectors having 15 degrees and the rest 6 having 45 degrees? How do i mask each 30 degree sector?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 6 月 10 日
t=-pi:0.01:pi;
r=1;
x=cos(t);
y=sin(t);
plot(x,y)
axis square
hold on
t1=linspace(-pi/2,pi/2,7)
x1=cos(t1);
y1=sin(t1);
x2=zeros(size(x1))
y2=zeros(size(x1))
plot([x1;x2],[y1;y2])
t1=linspace(pi/2,3*pi/2,13)
x1=cos(t1);
y1=sin(t1);
x2=zeros(size(x1))
y2=zeros(size(x1))
plot([x1;x2],[y1;y2])
  5 件のコメント
Image Analyst
Image Analyst 2016 年 6 月 10 日
She wanted six 45 degree sectors. The confusing part comes in the next sentence where she then refers to 12 30 degree sectors after she just said that there were supposed to be sectors of only 15 and 45 degrees. That's why I asked for the image.
MoonPie1
MoonPie1 2016 年 6 月 10 日
編集済み: Image Analyst 2016 年 6 月 10 日
My needs are as follows:
  1. I want to divide the image into 6 sectors named 1 to 6.
  2. I want to obtain a mask of each sectors such that only one sector is visible.
  3. After masking I want to multiply the mask with the original image.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2016 年 6 月 10 日
So I guess the problem is not solved yet. So, you should look at the FAQ http://matlab.wikia.com/wiki/FAQ#How_do_I_create_an_arc.3F and then once you have the coordinates of the sector, use the poly2mask() function to make your mask. Not hard. Let me know if you have problems.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by