Coloured circles on a mesh
이전 댓글 표시
I managed to get two coloured boxes on the mesh

I am struggling to imagine how I could get the circles with three different colours on this mesh

Any suggestions are most welcome.
채택된 답변
추가 답변 (1개)
What approach did you use to draw the rectangles?
The easiest approach to drawing circles in MATLAB is using the rectangle command and setting the Curvature to 1. This can only be used to draw circles in the X/Y plane, which looks (from your picture) like what you are trying to do.
rectangle('Position',[0 0 1 1],'Curvature',1,'FaceColor','green')
view(3)
grid on
box on
If you need circles in another plane, you have two options:
figure
h = hgtransform('Matrix',makehgtform('xrotate',pi/2));
rectangle(h,'Position',[0 0 1 1],'Curvature',1,'FaceColor','green')
view(3)
grid on
box on
Option 1b: You can also use an hgtransform to translate your circle if you need it somewhere other than at Z=0.
figure
h = hgtransform('Matrix',makehgtform('translate',[0 0 1]));
rectangle(h,'Position',[0 0 1 1],'Curvature',1,'FaceColor','green')
view(3)
grid on
box on
figure
t = linspace(0,2*pi,361);
x = zeros(size(t));
y = cos(t);
z = sin(t);
fill3(x,y,z,'g')
view(3)
카테고리
도움말 센터 및 File Exchange에서 Polygons에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



