Borrar filtros
Borrar filtros

Interpolation for 3D scattered data

3 visualizaciones (últimos 30 días)
Az
Az el 25 de Abr. de 2017
Comentada: Heru Leonardo el 22 de Abr. de 2020
a= [0 5 9 20 30 35] ; % cordinbates X
b= [0 4 27 31 35] ; % cordinbates Y
c= [1 5 6 8 10 20 ] ; % cordinbates Z
d= [40 40.1 40.2 40.4 40.1 40.1] ; % Temperature Values
[x,y,z] = meshgrid(a,b,c);
v = interp3(a,b,c,d,x,y,z);
does not work I need v to be interpolated for every 3D point (x,y,z). How can I perform? Thanks in advance

Respuestas (2)

KSSV
KSSV el 25 de Abr. de 2017
You have to make d a 3d matrix of size equal to x.
a= [0 5 9 20 30 35] ; % cordinbates X
b= [0 4 27 31 35] ; % cordinbates Y
c= [1 5 6 8 10 20 ] ; % cordinbates Z
d= [40 40.1 40.2 40.4 40.1 40.1] ; % Temperature Values
[x,y,z] = meshgrid(a,b,c);
d1 = repmat(d,size(x,1),1) ;
d2 = zeros(size(x)) ;
for i = 1:size(x,3)
d2(:,:,i) = d1 ;
end
v = interp3(a,b,c,d2,x,y,z);

Andrei Bobrov
Andrei Bobrov el 25 de Abr. de 2017
a= [0 5 9 20 30 35] ; % cordinbates X
b= [0 4 10 27 31 35] ; % cordinbates Y I'm fixed
c= [1 5 6 8 10 20 ] ; % cordinbates Z
d= [40 40.1 40.2 40.4 40.1 40.1] ; % Temperature Values
F = scatteredInterpolant(a(:),b(:),c(:),d(:));
[x,y,z] = meshgrid(a,b,c);
v = F(x,y,z);

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by