[下面的屏幕截图]
我用listplot在一些数据点上画了一条平滑的线。但是我想能够处理图的一阶和二阶导数,所以我想我可以用插值法创建一个实际的“函数”。但正如你在照片中看到的,它并不平滑。当我绘制[插值[…………]时,有一些奇怪的尖峰。我想知道ListPlot是如何得到它的插值函数的,以及如何使用插值[]或其他方法得到相同的结果。
谢谢,BR/>
Rob
这里有一些文本用于复制/粘贴:
mypoints=0.,3.87,1.21,4.05,2.6,4.25,4.62,4.48,7.24,4.73,9.66,4.93,
_12.48,5.14,14.87,5.33,17.34,5.55,19.31,5.78,20.78,6.01,22.08,6.34,
_22.82,6.7,23.2,7.06,23.41,7.54,23.52,8.78,23.59,9.59,23.62,9.93,
_23.72,10.24,23.88,10.56,24.14,10.85,24.46,11.05,24.81,11.2,
_25.73,11.44,27.15,11.63_
ListPlot[MyPoints,Joined->true,Mesh->full]
绘图[插值[mypoints][x],x,0,27.2]
< /代码>
最后一个有尖峰。
编辑…
Gleno指出我的列表图是线性的。但如果两个都有呢
插值顺序->3?
列表图[MyPoints,Joined->true,Mesh->full,InterpolationOrder->3]
绘图[插值[MyPoints,插值顺序->3][X],X,0,27.2]
< /代码>
.
谢谢,
抢劫
以下是一些用于复制/粘贴的文本:
myPoints = {{0.,3.87},{1.21,4.05},{2.6,4.25},{4.62,4.48},{7.24,4.73},{9.66,4.93},
{12.48,5.14},{14.87,5.33},{17.34,5.55},{19.31,5.78},{20.78,6.01},{22.08,6.34},
{22.82,6.7},{23.2,7.06},{23.41,7.54},{23.52,8.78},{23.59,9.59},{23.62,9.93},
{23.72,10.24},{23.88,10.56},{24.14,10.85},{24.46,11.05},{24.81,11.2},
{25.73,11.44},{27.15,11.63}}
ListPlot[myPoints, Joined -> True, Mesh -> Full]
Plot[Interpolation[myPoints][x], {x, 0, 27.2}]
最后一个有尖峰。
编辑…
Gleno pointed out that my List plot is linear. But what about when both have
InterpolationOrder -> 3?
ListPlot[myPoints, Joined -> True, Mesh -> Full, InterpolationOrder -> 3]
Plot[Interpolation[myPoints, InterpolationOrder -> 3][x], {x, 0, 27.2}]
