interp and interp3 give different size arrays
Afficher commentaires plus anciens
If I start with the following two arrays
x0 = 1:100;
y0 = 1:80;
z0 = 1:100;
and I make a mesh grid with them
[X0, Y0, Z0] = meshgrid(x0, y0, z0);
Now if I plug in x0 into interp and use a factor of 2 I get
xw = interp(x0,2);
size(xw)
ans =
1 200
Doing the same but with interp3 I expect to get a 160 x 200 x 200 array instead I get
Xw = interp3(X0,2);
size(Xw)
ans =
317 397 397
which is just 3 less than an additional factor of 2.
Why is that and how can I correct that?
I have some flow data that is in an N x M x P array A
M = length(x0);
N = length(y0);
P = length(z0);
size(A)
ans =
80 100 100
using these numbers. I want to interpolate the 3D data onto a finer mesh rN x rM x rP where r is some integer >= 2. Can I do this with interp3 or do I need to use something else?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Interpolation dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!