使用 sinc 函数对数据集进行插值 - MATLAB
我想使用 sinc 函数对我已经采样的一些数据进行插值。我对 Matlab 不太熟悉,但我发现了以下脚本:
rng default
t = 1:10;
x = randn(size(t))';
ts = linspace(-5,15,600);
[Ts,T] = ndgrid(ts,t);
y = sinc(Ts - T)*x;
plot(t,x,'o',ts,y)
xlabel Time, ylabel Signal
legend('Sampled','Interpolated','Location','SouthWest')
legend boxoff
我了解如何更改格式。 我的问题是,我该如何对自己的采样数据执行此操作? 任何帮助将不胜感激。非常感谢!
编辑:我多次尝试用自己的 x 值替换 x 值,但每次运行代码时它都会恢复为原始值。我不知道为什么会发生这种情况......
I want to use the sinc function to interpolate some data I already have sampled. I am not very familiar with Matlab, but I found the following script:
rng default
t = 1:10;
x = randn(size(t))';
ts = linspace(-5,15,600);
[Ts,T] = ndgrid(ts,t);
y = sinc(Ts - T)*x;
plot(t,x,'o',ts,y)
xlabel Time, ylabel Signal
legend('Sampled','Interpolated','Location','SouthWest')
legend boxoff
I understand how to change the formatting.
My question is, how can I do this for my own sampled data?
Any help would be greatly appreciated. Thank you very much!
Edit: I tried replacing the x-values with my own multiple times, but each time it reverts to the original when I run the code. I'm not sure why this happens...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论