how do i fill rectangle with color?

18 views (last 30 days)
원우 조
원우 조 on 7 Dec 2021
Commented: Star Strider on 7 Dec 2021
rectangle('Position',[0 0 2 4],'Curvature',0.2)
how do i color this rectangle into red? somebody please help me

Answers (1)

Star Strider
Star Strider on 7 Dec 2021
This is how —
figure
rectangle('Position',[0 0 2 4],'Curvature',0.2, 'FaceColor','r')
.
  2 Comments
원우 조
원우 조 on 7 Dec 2021
how do i make it into this shape?
Star Strider
Star Strider on 7 Dec 2021
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.
.

Sign in to comment.

Categories

Find more on Visual Exploration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!