How do I fill the color in the block? This is the function I'm using.

조회 수: 2 (최근 30일)
Kiha Kim
Kiha Kim 2021년 12월 7일
답변: KSSV 2021년 12월 7일
hold on
x = [4 5 5 4 4]
y = [13 13 12 12 13]
plot(x,y,'y')
axis equal
hold off
hold on
x = [4 4 5 5 4]
y = [12 11 11 12 12]
plot(x,y,'g')
axis equal
hold off
hold on
x = [4 4 5 5 4]
y = [11 10 10 11 11]
plot(x,y,'g')
axis equal
axis([0 9 0 13])

채택된 답변

KSSV
KSSV 2021년 12월 7일
Read about patch.
hold on
x = [4 5 5 4 4]
x = 1×5
4 5 5 4 4
y = [13 13 12 12 13]
y = 1×5
13 13 12 12 13
patch(x,y,'y')
axis equal
hold off
hold on
x = [4 4 5 5 4]
x = 1×5
4 4 5 5 4
y = [12 11 11 12 12]
y = 1×5
12 11 11 12 12
patch(x,y,'g')
axis equal
hold off
hold on
x = [4 4 5 5 4]
x = 1×5
4 4 5 5 4
y = [11 10 10 11 11]
y = 1×5
11 10 10 11 11
patch(x,y,'g')
axis equal
axis([0 9 0 13])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by