How to plot discrete points over a continuous curve?

7 Ansichten (letzte 30 Tage)
Andrew
Andrew am 2 Apr. 2013
I am trying plot a theoretical curve along side discrete test points on the same plot. The idea is that the theoretical curve is a continuous function over a range, but the test points are only a few discrete points over the same range. (Think, continuous line over a few X's). How would I do this? I don't want to stretch the test point vector to the same length of the continuous curve by zero-padding because that adds a bunch of false X's to the plot. Conversely, shrinking the theoretical vector to the length of the test vector gives a very jagged, inaccurate theoretical curve. All I want to do is to include a few discrete marks on the same scale as the continuous theoretical curve.

Antworten (1)

the cyclist
the cyclist am 2 Apr. 2013
One of many possible ways:
xd = 2:5;
yd = 3:6;
xt = 1:0.01:6;
yt = xt + 1;
figure
hold on
plot(xd,yd,'.')
plot(xt,yt,'-')

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by