Solid interpolation from surfaces

5 次查看(过去 30 天)
I have an external set of 4D data with dimensions (k,l,m,n), from which I have first created a cell array {m,n}(k,l), then I have used a matrix to sum the different matrices on the single column in m and interpolated, creating n surfaces. Using interp2 and defining the desired point on one of the n surfaces, I can obtain the desired value for the fixed n value of the surface.
This is the code relative to it:
[Xq,Zq]=meshgrid(linspace(palpha_n,palpha_x,dxsurf*palpha_dx),linspace(pRe_n,pRe_x,dxsurf*pRe_dx));
alpha=20;
Re=4e6;
Ma=0.12;
pol_r=cell(1,size(pol_surf,2));
for iMa=1:size(pol_surf,2)
j=1;
for iRe=1:size(pol_surf,1)
for ialpha=1:size([pol_surf{iRe,iMa}],1)
pol_r{iMa}(j,:)=num2cell(pol_surf{iRe,iMa}(ialpha,:));
j=j+1;
end
end
figure
scatter3(cell2mat(pol_r{iMa}(:,1)),cell2mat(pol_r{iMa}(:,2)),cell2mat(pol_r{iMa}(:,8)),'filled','Color',[iMa./size(pol_surf,2) iMa./size(pol_surf,2) iMa./size(pol_surf,2)]);
FCl=scatteredInterpolant(cell2mat(pol_r{iMa}(:,1)),cell2mat(pol_r{iMa}(:,8)),cell2mat(pol_r{iMa}(:,2)));
Clq(:,:,iMa)=FCl(Xq,Zq);
Cl_interp(:,iMa)=mesh(Xq,Clq(:,:,iMa),log10(Zq));
Cl(:,iMa)=interp2(Xq,Zq,Clq(:,:,iMa),alpha,Re);
end
I would like now to interpolate the n surfaces into a solid, in order to replicate the same interpolation process on the higher dimension and keeping the information relative to the surface, but I have no idea how to tackle the problem.
Any suggestions?

回答(1 个)

Shubham
Shubham 2023-9-27
I understand that you have created n surfaces from the 4D data and now you want to interpolate these surfaces into a solid.
You can use the “interp3” function for interpolating the 3D data in a mesh-grid format.
You can also refer to griddedInterpolant function which can perform interpolation on N-D gridded data set.
For more information please refer to:
Hope this helps!!

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by