How to draw lines in matlab

조회 수: 3 (최근 30일)
Aditya Shau
Aditya Shau 2018년 7월 27일
댓글: Wilmar Lima 2019년 11월 11일
Suppose x axis values are (30,40,50) and its corresponding y-axis values are (100,200,300). How to draw three different line in a plot with (30,100) one line,(40,200) one line and (50,300) one line. Thank you.

답변 (1개)

KSSV
KSSV 2018년 7월 27일
편집: KSSV 2018년 7월 27일
X = [30,40,50] ;
Y = [100,200,300] ;
plot(X,Y,'.-r')
REad about plot
  댓글 수: 6
Aditya Shau
Aditya Shau 2018년 7월 27일
let me make my question clear..in x-axis I have some values and y-axis some values. I want to draw a continuous line from a point of the x-axis to y-axis. so,suppose we have to draw the contiious line from x-axis value (let 30) to yaxis value (let 100).. like in the attachment.i need to only connect the points through continious line.
Wilmar Lima
Wilmar Lima 2019년 11월 11일
X = [30,0];
Y = [0,100];
plot(X,Y,'.-r') A red line

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

Community Treasure Hunt

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

Start Hunting!

Translated by