How to interpolate a not gridded N-Dim matrix ?

1 次查看(过去 30 天)
Hello,
I have searched in latest posts to find answers for my problem but I did not find a solution that match my N-Dim issue.
I have a matrix 25x33 which is not gridded (see below) and I want to linearly interpolate values. To do this I have found the programm inpaintn.m which solve this issue.
matrix.png
The fact is that this 25x33 matrix is a reshape array of 825x1 values stored in a 135000x825x9x3 matrix... The execution time of the programm does not allow me to deal the problem with for loops like this :
for j=1:Nnodes_calc
pourcent=round(100*j/Nnodes_calc,1);
waitbar(j/Nnodes_calc,h1,['Traitement [' num2str(pourcent) '%] ']);
for k = 1:9
for l=1:3
Matrix_Temp=reshape(Data_calcul.sigma(j,:,k,l),49,1);
Mat_tot(I_point)=Matrix_Temp; % Filling the 25x33 matrix with the 49 known values of the array 49x1
Mat_tot_a=inpaintn(Mat_tot,400);
Full_Mat(j,:,k,l)=reshape(Mat_tot_a,825,1);
end
end
end
Nb : I_point are the corresponding linear index of the 49 known values. These 49 known values are stored in a 135000x49x9x3 matrix.
It would take 5 days to treat the problem and I do not have so much time.
I would like to have a solution to interpolate the 25x33 matrix through the x9 and x3 directions but I don't want to interpolate between the x9 and x3 dimensions.
The solution with interpn could look like this : interpn(x_val,y_val,1:9,1:3,Matrix(25x33x9x3),x_interp,y_interp,1:9,1:3) but it is impossible with not gridded datas.
I have written this post to have some ideas to solve this problem.
Thank you for your help.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by