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

조회 수: 11 (최근 30일)
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개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by