Draw a five star
5 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
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 件のコメント
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
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
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!