I need help randomizing the points of the traingle

1 回表示 (過去 30 日間)
Amanda
Amanda 2022 年 11 月 28 日
編集済み: Voss 2022 年 11 月 28 日
I need help radomizing the points of the triangle just like the color/markersize/edgecolor change.
  3 件のコメント
Amanda
Amanda 2022 年 11 月 28 日
there arent any constraints
Voss
Voss 2022 年 11 月 28 日
編集済み: Voss 2022 年 11 月 28 日

サインインしてコメントする。

回答 (1 件)

David Hill
David Hill 2022 年 11 月 28 日
figure;hold on;
for k=1:10
p=polyshape(rand(3,1),rand(3,1));
plot(p)
end
  2 件のコメント
Amanda
Amanda 2022 年 11 月 28 日
I dont want mulitple triangle on the graph I want it to randomize one triangle
Torsten
Torsten 2022 年 11 月 28 日
編集済み: Torsten 2022 年 11 月 28 日
And what does it mean: "randomize one triangle" ?
According to how a normal person would interprete it, you already did this in your code: You randomly chose 3 points in 2d space (most probably meant as the corner points of a triangle).
Or do you need random points inside a fixed triangle ?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by