【问题标题】:Find intersection points of two ListPlot's in Mathematica在 Mathematica 中查找两个 ListPlot 的交点
【发布时间】:2012-10-15 05:39:24
【问题描述】:

我有两组离散数据,我用 Mathematica 中的 ListPlot 将它们绘制为两种不同的颜色(红色和蓝色)。我想找到这两者之间的交点(相应连续曲线的),即如图所示的点 A 和 B。

我尝试了“FindCluster”方法并跳来获取数据形成行的子集,但效果不佳。

现在我总是使用“GetCoordinate”属性直接从图表中获取数字。如果有一种方法可以自动且更准确地执行此操作,那就太好了。

【问题讨论】:

    标签: wolfram-mathematica


    【解决方案1】:

    我不确定这对你来说是否方便,但我有时会让 Mathematica 插入点列表,然后求解交点:

    findGuesses[pointsTable1_, pointsTable2_] := 块[{interpolatingPolyF1, interpolatingPolyF2}, 插值PolyF1 = 函数[{x},评估[InterpolatingPolynomial[pointsTable1,x]]]; 插值PolyF2 = 函数[{x},评估[InterpolatingPolynomial[pointsTable2,x]]]; (*打印[绘图[{interpolatingPolyF1[x],interpolatingPolyF2[x]},{x,0,2}]];*) {x, y} /。 NSolve[{y == interpolatingPolyF1[x], y == interpolatingPolyF2[x]}, {x, y}, Reals] ]

    【讨论】:

    • 这在我的情况下不起作用,因为无法插入我拥有的数据(从图中可以看出它们是多值函数)。我认为您提供的解决方案仅适用于单值函数。还是谢谢你。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-04
    • 1970-01-01
    相关资源
    最近更新 更多