如何知道一个点是否属于插值曲面

时间:2019-07-04 13:34:25

标签: matlab interpolation

我有一个测深图(海床),它是一个经度x纬度矩阵,其值是每个点的海深。 我已经对泥沙运输进行了建模,因此我可以了解其深度,纬度和经度。 我想知道是否有人如何测试沉积物是否在海床上。 当然,深度图的经度和纬度与沉积物的坐标不匹配。

我认为我必须进行插值,但是我没有做到。

这就是我所做的:

x=squeeze(lon_rho(1,:)); 
y=squeeze(lat_rho(:,1));
[xq,yq]=meshgrid(lons(360,:),lats(360,:)); %360 is the time step i chose
vq = griddata(x,y,h,xq,yq);  %%creating the surface
for i=1:length(depths(:,1))
    for j=1:length(depths(1,:))
        if depths(i,j)==vq(find(xq==lons(i,j)),find(yq==lats(i,j)))
            lons(i:end,j)=lons(i,j); %if sediments at the bottom they dont move anymore
            lats(i:end,j)=lats(i,j);
        end
    end
end

this image shows my workspace  纬度和经度代表沉积物的经度,纬度和深度

我遇到此错误:

位置1的索引超出了数组范围(不得超过1000)。

test_unterpolation中的错误(第20行)         如果depths(i,j)== vq(find(xq == lons(i,j)),find(yq == lats(i,j)))

0 个答案:

没有答案