how to draw multiple lines?

4 ビュー (過去 30 日間)
Eman S
Eman S 2018 年 8 月 4 日
編集済み: Eman S 2020 年 2 月 2 日
Hi all, how to draw multiple lines that have (start point (0,0) with different angles 0:5:90 degrees)?? any suggestions for code??
  1 件のコメント
Image Analyst
Image Analyst 2020 年 2 月 1 日
Original question
how to draw multiple lines that have (start point (0,0) with different angles 0:5:90) ??
Hi all, how to draw multiple lines that have (start point (0,0) with different angles 0:5:90 degrees)?? any suggestions for code??

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

採用された回答

Star Strider
Star Strider 2018 年 8 月 4 日
Try this:
deg = 0 : 5 : 90;
r = 1;
x = r*[zeros(size(deg(:))) cosd(deg(:))];
y = r*[zeros(size(deg(:))) sind(deg(:))];
figure
plot(x', y', 'LineWidth',2)
axis equal
Here, ‘r’ (the radius value) defines the end points for each line. If you want different lengths for each line, ‘r’ becomes a (19x1) vector with a different value assigned to each element.
  2 件のコメント
Eman S
Eman S 2018 年 8 月 4 日
Thanks. It worked.
Star Strider
Star Strider 2018 年 8 月 4 日
As always, my pleasure!

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

その他の回答 (1 件)

Rohit Rao
Rohit Rao 2018 年 8 月 4 日
Have you tried running the plot command inside a loop ?!

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by