Skip to content

琐碎的 Mathematica 使用

  • 快速给定两点求直线方程表达式 -> 求插值函数问题
    Simplify[InterpolatingPolynomial[{{-2.0, 10^4}, {-1.95, 1}}, x]]
    
  • 分段函数
    Module[{x0 = 1, c, a}, a = 3; c = Exp[a*x0];
     Plot[Piecewise[{{Exp[a*x], x <= x0}, {-Log[x] + c, x > x0}}], {x, -1,
        10}, PlotRange -> All]]