how do i fill rectangle with color?

rectangle('Position',[0 0 2 4],'Curvature',0.2)
how do i color this rectangle into red? somebody please help me

답변 (1개)

Star Strider
Star Strider 2021년 12월 7일

0 개 추천

This is how —
figure
rectangle('Position',[0 0 2 4],'Curvature',0.2, 'FaceColor','r')
.

댓글 수: 2

원우 조
원우 조 2021년 12월 7일
how do i make it into this shape?
Set the axis scaling to 'equal' and the proportions are now correct.
figure
rectangle('Position',[0 0 2 4],'Curvature',0.2, 'FaceColor','r') % Original
axis('equal')
figure
rectangle('Position',[0 0 2 4],'Curvature',0.2, 'FaceColor','r') % Original
rectangle('Position',[3 2 2 1],'Curvature',0.2, 'FaceColor','g') % Additional
axis('equal')
These work.
.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2021년 12월 7일

댓글:

2021년 12월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by