interp1q
(不推荐)快速一维插值
不推荐使用 interp1q
。请改用 interp1
。
说明
示例
输入参数
x
— 样本点
列向量
采样点,指定为单调递增的列向量。x
中的采样点是 Y
中采样数据的 x 坐标。
示例: [1; 2; 3; 4]
示例: [1.1; 2.4; 3.2; 4.7]
数据类型: single
| double
复数支持: 是
Y
— 样本数据
列向量 | 矩阵
采样数据,指定为列向量或矩阵。Y
中的采样数据表示 x
中坐标处的函数值。
如果
Y
是列向量,则它必须包含length(x)
个元素。输出yi
的长度等于length(xi)
。如果
Y
是矩阵,则它必须包含length(x)
行,并且对Y
的每列执行插值。在这种情况下,yi
的大小为length(xi)
×size(Y,2)
。
示例: [1; 4; 9; 16]
示例: [0.1; 1.4; 2.2; 3.7]
数据类型: single
| double
复数支持: 是
xi
— 查询点
列向量
查询点,指定为列向量。查询点是 interp1q
使用线性插值来确定 Y
表示的函数的逼近值的位置。
对于超出 x
轴坐标的任何 xi
值,interp1q
将返回 NaN
。
示例: [1.5; 2.5]
数据类型: single
| double
复数支持: 是
扩展功能
C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。
用法说明和限制:
当某些
Y
值为Inf
或NaN
时,结果可能与 MATLAB® 不匹配。
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
此函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
版本历史记录
在 R2006a 之前推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)