How to use 3D interpolation in matlab script?

3 visualizaciones (últimos 30 días)
Abhinav Vshisth
Abhinav Vshisth el 18 de Nov. de 2015
The code is as follows:
cylinder_1=[2,8];
speed=[0,800,1000];
power=[1,137,155];
Values(:,:,1)=[0,0,0;0,2,8];
Values(:,:,137)=[0,0,0;0,-4,0];
Values(:,:,155)=[0,0,0;0,0,-7];
[X,Y,Z]=meshgrid(speed,cylinder,power);
V=interp3(X,Y,Z,Values,2,800,137);
When I use interp3 function, I get the following error message:
Error using griddedInterpolant The grid was created from grid vectors that were not strictly monotonic increasing.
Error in interp3 (line 142) F = griddedInterpolant(X, Y, Z, V, method,extrap);
When I use the command "griddedInterpolant" instead of "interp3" I get the following error message:
Error using griddedInterpolant The number of input coordinate arrays does not equal the number of dimensions (NDIMS) of these arrays.
Basically, I have values only for 2 cylinders, 3 speeds and 3 powers. I want to linearly interpolate for rest of the data between these values.

Respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by