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

6 次查看(过去 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