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 CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by