How to plot discrete points over a continuous curve?
10 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
the cyclist
2013-4-2
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,'-')
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!