【发布时间】:2017-05-15 19:44:23
【问题描述】:
我有一个 MATLAB 3D 矩阵,我想在第三维中插值。我正在使用 MATLAB interp3 来执行此操作:
final_3D_mat=interp3( hor_inds_mm, vert_inds_mm, prev_depth_axis_mm,...
prev_3D_mat, ...
hor_inds_mm, vert_inds_mm, new_depth_axis_mm )
使用的数组的大小:
size(prev_3D_mat)
size(hor_inds_mm)
size(vert_inds_mm)
size(prev_depth_axis_mm)
size(new_depth_axis_mm)
ans =
337 507 17
ans =
1 507
ans =
1 337
ans =
1 17
ans =
1 337
我不想在调用 interp3 之前调用 meshgrid,并使用 interp3 的 X、Y、Z 参数作为向量。但是我不断收到以下错误:
??? Error using ==> interp3 at 128
XI,YI, and ZI must be the same size or vectors of different
orientations.
我试图交换 hor_inds_mm 和 vert_inds_mm 参数的位置,但得到了错误:
??? Error using ==> interp3 at 128
The lengths of X,Y and Z must match the size of V.
我也尝试像这样改变向量的方向:
final_3D_mat=interp3( hor_inds_mm, vert_inds_mm', permute(prev_depth_axis_mm,[1 3 2]),...
prev_3D_mat, ...
hor_inds_mm, vert_inds_mm',permute(new_depth_axis_mm,[1 3 2]));
但我得到了同样的错误:
??? Error using ==> interp3 at 128
XI,YI, and ZI must be the same size or vectors of different
orientations.
有人可以帮忙吗??
【问题讨论】:
标签: matlab