Struggling with line()

조회 수: 1 (최근 30일)
Arjun Muralidaran
Arjun Muralidaran 2020년 2월 20일
댓글: Arjun Muralidaran 2020년 2월 20일
Hi,
I am trying to plot a line using the line command:
code is the following
a = [0 0]; b = [40 0];
line(a,b, 'color', 'k','LineWidth',2)
However, when I plot I get a line from (0,0) to (0,40) like so:
I have absolutely no idea why this is happening and have tried running on a friend's computer to make sure I am not going crazy. Please let me know if there is a glaring issue here that I have missed or how I can fix this. Thanks in advance

채택된 답변

Walter Roberson
Walter Roberson 2020년 2월 20일
The first parameter is a list of x coordinates. The second parameter is a list of y coordinates.
The parameters are not source xy pair and destination xy pair.
  댓글 수: 2
madhan ravi
madhan ravi 2020년 2월 20일
Yes , got stuck in this for a while and it is clear now :)
Arjun Muralidaran
Arjun Muralidaran 2020년 2월 20일
Thank you sir!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by