线性插值用c语言程序源代码,实现快速线性插值的实现

lininterp1f函数用于使用线性插值在指定坐标X上返回1-D函数Y的值。X必须单调递增,Y长度与X相同,XI为数组。示例中展示了如何使用该函数进行插值计算,并提供了在不同操作系统下的安装指南。
摘要由CSDN通过智能技术生成

Fast Linear Interpolation

F = lininterp1f(X,Y,XI,Ydefault) returns the value of the 1-D function Y at the points XI using linear interpolation. Length(F)=length(XI). The vector X specifies the coordinates of the underlying interval. Ydefault is returned for values of XI outside the coordinates in X.

For lininterp1f to work properly:

X must be a monotonically increasing array;

Y must be an array with length(Y)=length(X);

XI must be an array.

Ydefault must be a scalar value or an empty matrix [].

Example:

>> x = [1:1:1000];

>> y =log(sqrt(x+1.001)-1.001);

>> xv =[5:.001:100];

>> yinterp =lininterp1f(x,y,xv,[]);

Warning: not much in the way of error checking, since this slows things down, so pay attention to the argument passed to the function!!!

Installation (Windows users):

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值