fitPiecewiseLinear(​t, z, tGuess)

版本 1.0.0.0 (3.1 KB) 作者: Matthew Kelly
Computes a best-fit linear spline with arbitrary grid spacing
184.0 次下载
更新时间 2017/3/7

查看许可证

% [tGrid, zGrid] = fitThreeLines(t, z, tMidGuess)
%
% This function fits a piecewise linear function to a data set. The number
% of knot points is fixed, but the optimization computes the optimal grid
% spacing and the value at each knot point.
%
% INPUTS:
% t = [1,n] = time stamp
% z = [1,n] = data value
% tGuess = [1,k] = guess at the knot times. Mapped to [t(1), t(end)]
%
% OUTPUTS:
% tGrud = [1, k] = knot times for best-fit linear spline
% zGriz = [1, k] = data values for best-fit linear spline
% objVal = scalar = fitting error for the best-fit solution
% exitFlag = FMINCON exit flag for data fitting
%

引用格式

Matthew Kelly (2024). fitPiecewiseLinear(t, z, tGuess) (https://www.mathworks.com/matlabcentral/fileexchange/61915-fitpiecewiselinear-t-z-tguess), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2015b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Spline Construction 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0