Connecting a line from the first data point to the last data point

조회 수: 4(최근 30일)
birdnerd007
birdnerd007 2020년 7월 10일
댓글: birdnerd007 2020년 7월 10일
I have a 2D scatter plot. I am trying to create a line that connects from the very first data point to the very last data point only. I would appreciate any help. I have a total of 40 data points.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 7월 10일
x=1:10;
y=rand(size(x));
scatter(x,y);
line(x([1 end]),y([1,end]))

추가 답변(0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by