【问题标题】:How to integrate best fit line in MatLab?如何在 MatLab 中集成最佳拟合线?
【发布时间】:2015-08-14 04:19:32
【问题描述】:

我有各种点列表,这些点被绘制并生成如下图:

有没有办法在最佳拟合线上进行积分以获得曲线下的面积?

【问题讨论】:

  • 您确定要在曲线上进行 linear 拟合吗?如果有,您是否有 Curve Fitting Toolbox?因为,它提供了一个函数integrate():“这个MATLAB函数在向量x指定的点处积分cfit对象fun,从x0开始,并以int形式返回结果。”

标签: matlab plot numerical-integration


【解决方案1】:

是的,您可以使用trapz 整合一组离散数据:http://www.mathworks.com/help/matlab/math/integration-of-numeric-data.html

假设你的x轴数据保存到向量t,你的最佳拟合线数据保存到fx,那么面积很容易计算如下:

area = trapz(t, fx);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-24
    • 2014-09-07
    • 2011-07-18
    • 2019-04-09
    • 1970-01-01
    • 1970-01-01
    • 2022-11-23
    • 1970-01-01
    相关资源
    最近更新 更多