Trilinear interpolation of data from measurements
4 views (last 30 days)
Show older comments
Hi all,
I have three arrays (x_position, y_position, z_position) which form the position in 3D and a corresponding array for the value at each position. All of them have a size of 68*1 values.
Now I want to do a trilinear interpolation between the value points at each position.
For this purpose I've found the promising matlab function interp3. But therefor I would need a matrix (68 * 68 * 68) for each position and the corresponding values. How can I generate them? For the position I've used the meshgrid function:
[xq,yq,zq] = meshgrid(x, y, z))
and
[X,Y,Z] = meshgrid(-34:1:33, -34:1:33, 1:1:68)
Now I have Matrices for the positions.
But how to generate a matrix for the value?
scatteredInter = scatteredInterpolant(x', z', y', stdX_C1', 'linear');
vq = scatteredInter(xq, zq, yq);
This creates a 68*68*68 matrix for vq. Afterwards I used slice to visualize the interpolation. But it looks not as expected! The interpolation isn't smooth at all. I want to have a smooth interpolation. It can be seen in the attached file "slice.fig". I've also attached my m-file for interpolating and the x, y, z and value(stdX_C1) array in "position_value.mat".
I'm really looking forward for any idea or solution. Thanks a lot! Juliane
0 Comments
Answers (0)
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!