How can I join points with line

조회 수: 2 (최근 30일)
Tanvir Hossain
Tanvir Hossain 2020년 1월 13일
댓글: darova 2020년 1월 16일
I've 4 points. I want to join first two of the with a line and then second two with another line
My desired picture is given below
Untitled.png
I can draw the first graph with maker. but but I want to join these points.
Thanks in advance

채택된 답변

Adam Danz
Adam Danz 2020년 1월 13일
Use matrix inputs. A line is drawn for each column of inputs. The first matrix defines the x values, the 2nd matrix defines the y values.
plot([0 1; 1.5 3],[1 2; 5 6], 'r-o')
  댓글 수: 1
darova
darova 2020년 1월 16일
please accept my answer too

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

추가 답변 (1개)

darova
darova 2020년 1월 13일
Try to reshape data
a1 = reshape(a,[],2);
b1 = reshape(b,[],2);
plot(a1,b1)
% plot(a1',b1') % another variant

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by