Simple interpolation of irregular grid problem. meshgrid
is useful.
x = [4,1,6,5,1,6];
y = [1,1,1,3,3,3];
v = [1,2,4,2,4,5];
[xq,yq] = meshgrid(1:max(x), 1:max(y));
vq = griddata(x,y,v,xq,yq);
You need to explicitly define the x- and y- positions (this case row and column numbers) of your V data. Then use meshgrid
to generate a grid (this case the matrix itself). Then use griddata
to interpolate the data over the grid that you just created. vq
is the resulting matrix you want.