How to connect data on a scatter plot in MatLab?

1 回表示 (過去 30 日間)
Robert  Flores
Robert Flores 2018 年 5 月 6 日
編集済み: the cyclist 2018 年 5 月 6 日
Hello,
I am trying to connect my data with a line. In my code I have the three points plotted, I just need them to connect. Also, if you know of a way to have my last plot be at the number of elements equal to Inf,that would help a lot, thanks. If you need to see all my code it's in the attachments.
Code:
figure;scatter(5,U5(n5+1),'m *')
hold on
scatter(10,U10(n10+1),'m *')
scatter(20,U20(n20+1),'m *')
xlim([0 30])
title('Deflection V. Number of Elements')
xlabel('Number of Elements')
ylabel('Deflection')

回答 (1 件)

the cyclist
the cyclist 2018 年 5 月 6 日
編集済み: the cyclist 2018 年 5 月 6 日
You could use the plot command instead. Something like
figure
plot([5 10 20],[U5(n5+1) U10(n10+1) U20(n20+1)],'m*-')
See the documentation for plot for details.

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by