I have a 310*400 matrix, that contain NAN values. I will like to interpolate the data to eliminate the NAN. After applying this code, I observed that the NAN is still retained. A sample of my code is here.
load('km100.dat'); % load the z column data
[x,y] = ndgrid(310,400); % arrange the data into grid
data_nan=reshape(km100,[],400); %
row_vect = 1:310; %col_vect = 1:400; %[X,Y] = meshgrid(col_vect, row_vect);[Xq,Yq] = meshgrid((1:1:310),(1:1:400));V = data_nan;data_interp = interp2(X, Y, V, Xq', Yq', 'cubic');
How do I correct it? Thanks.
Best Answer