MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   在MATLAB中统计扩展序列 (https://www.labfans.com/bbs/showthread.php?t=23012)

poster 2019-12-10 16:49

在MATLAB中统计扩展序列
 
MATLAB中是否有任何内置函数可以统计地扩展实数序列,以便将结果序列扩展为我想要的任何大小。我有一个499个元素的序列,我想将其扩展到4096个元素。提前致谢。


回答:
如果您想将499个元素的向量插值以更高分辨率的4096个元素,则可以按以下方式使用[URL="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/interp1.html"]INTERP1[/URL]函数(其中x是499个元素的向量):

y = interp1(x,linspace(1,499,4096)); 上面的函数使用[URL="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/linspace.html"]LINSPACE[/URL]函数来生成一个4096元素的矢量,其值在1到499之间线性间隔,然后用作插值点。默认情况下,INTERP1函数使用线性插值来计算旧点之间的新值。您可以通过以下方式使用其他插值方法:

y = interp1(x,linspace(1,499,4096),'spline'); %# Cubic spline method y = interp1(x,linspace(1,499,4096),'pchip'); %# Piecewise cubic Hermite method

[url=https://stackoverflow.com/questions/1956678]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:11

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.