How to get sub-circles from orignal circle

1 Ansicht (letzte 30 Tage)
Mekala balaji am 22 Mär. 2019
Beantwortet: Image Analyst am 24 Mär. 2019
Hi,
I have circle with diameter 1, I use below code:
meshgrid(x,y)
Fig,surf(x,y,z,'facecolor','interp','edgecolor',none);view(2)
xlim([0 1]),ylim([0 1))
colorbar;colormap(hot);
Now I want plot a circle
figure2. Keep original circle diameter 0-0.39 from bottom as it is, and fill rest of the original area with black color
Figure3: Keep original circle diameter 0.39~1 (up or top) as it is, and fill rest of the original area with black color
Figure4: Keep original circle diameter 0~63 from left as it is, and fill rest of the original area with black color
Figure5: Keep original circel diameter 0.4~1 to right as it is,and fill rest of the original area with black color
Kindly some help to do this.
4 Kommentare2 ältere Kommentare anzeigen2 ältere Kommentare ausblenden
Mekala balaji am 24 Mär. 2019
Keep the original color in the specified diameter range, and fill the outside this range as black,
Mekala balaji am 24 Mär. 2019
N = 256;
c = colormap(jet(N));
th = linspace(0, 2*pi, N);
r = 0:0.5:1;
[TH,R] = meshgrid(th,r);
[X,Y] = pol2cart(TH,R);
C = bsxfun(@times,(X + Y),th);
figure(1)
surf(X,Y,C)
view([0 90])
axis square
grid off
I want keep the circle as it is as above in 0.39~0.6 diameter range, and fill rest of the area in black color

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst am 24 Mär. 2019
See this color wheel example. Adapt as needed.
0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by