![](/img/trans.png)
[英]MATLAB: Permute and reshape a N x 4 array into a 2 x 2 x N array
[英]Interpolate in a 2x2x5 array to get new 2x2x9 array
如何使用具有 9 个查询值的向量在 2x2x5 数组的第 3 维中插值,基于 5 个样本,以获得新的 2x2x9 数组?
可能使用 griddedInterpolant 或 interp1,例如 RT = interp1(X, R, XQ)。
X = [1 3 5 7 9];
XQ = [1 2 3 4 5 6 7 8 9];
R = [1 6; 11 16];
R(:,:,2) = [2 7; 12 17];
R(:,:,3) = [3 8; 13 18];
R(:,:,4) = [4 9; 14 19];
R(:,:,5) = [5 10; 15 20];
RT = [1 6; 11 16 ];
RT(:,:,2) = [1.5 6.5; 11.5 16.5];
RT(:,:,3) = [2 7; 12 17 ];
RT(:,:,4) = [2.5 7.5; 12.5 17.5];
RT(:,:,5) = [3 8; 13 18 ];
RT(:,:,6) = [3.5 8.5; 13.5 18.5];
RT(:,:,7) = [4 9; 14 19 ];
RT(:,:,8) = [4.5 9.5; 14.5 19.5];
RT(:,:,9) = [5 10; 15 20 ];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.