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

circledivisionImage Processing Toolboxsector

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?

Best Answer

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])