Draw a five star

조회 수: 1 (최근 30일)
Dung Tran Hoang
Dung Tran Hoang 2020년 4월 22일
댓글: KSSV 2020년 4월 26일
I have a homework to draw a star on matlab: Let the vertices of a five star be (6.5, 0),(9, 5),(14, 5.5),(10.5, 9),(12, 14), (6.5, 11.5),(2, 14),(3.5, 9),(0, 5.5),(5, 5). Draw the graph of the above vertices. Anyone have any idea

채택된 답변

KSSV
KSSV 2020년 4월 22일
편집: KSSV 2020년 4월 22일
Read about plot.
A = [ 6.5, 0
9, 5,
14, 5.5,
10.5, 9,
12, 14,
6.5, 11.5,
2, 14,
3.5, 9,
0, 5.5
,5, 5
6.5, 0 ] ;
plot(A(:,1),A(:,2))
If you want color use:
patch(A(:,1),A(:,2),'r')
  댓글 수: 2
Tien Dat Pham
Tien Dat Pham 2020년 4월 25일
Can you explain me the line:
plot(A(:,1),A(:,2))
Thank you!
KSSV
KSSV 2020년 4월 26일
A(:,1) picks the entire first column, this is x data.
A(:,2) picks the entire second column, this is y data.

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

추가 답변 (1개)

Nhan Huynh
Nhan Huynh 2020년 4월 26일
Let the vertices of a five star be (6.5,0),(9,5),(14,5.5),(10.5,9),(12,14), (6.5,11.5),(2,14),(3.5,9),(0,5.5),(5,5). Draw the graph of the above vertices and the graph of the new vertices after performing the matrix transformation T =( 0 1/2 ;1/2 0 ).Can someone help me with that, please

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by