how to draw multiple lines?

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 个评论

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??

请先登录,再进行评论。

 采纳的回答

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.

更多回答(1 个)

Rohit Rao
Rohit Rao 2018-8-4

0 个投票

Have you tried running the plot command inside a loop ?!

类别

帮助中心File Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by