Multidimensional interpolation with table data

4 views (last 30 days)

I need to apply multidimensional interpolation. The data set is such that I have 16 variants, each of those variants is defined on the basis of 6 dimensions (length, width, diameter...). Each combination of dimensions out of those 16 is different, but certain dimensions, e.g. diameter=100mm repeat in different combinations. For each of the 16 variants I have a table of results, the table is 9x11 in size. I need to have a program that, when I select 6 dimensions, interpolates using the spline method between the existing dimensions and gives a 9x11 table as a result.

I tried several options, here is an example.

griddedInterpolant({dim1, dim2, dim3, dim4, dim5, dim6}, [res1, res2, res3,........res16],'spline')

error is: "Interpolant is in invalid state. Gridvector must define grid whose size is compatible with the values ​​array". dim1, dim2 are class double size 16x1. res1, res2 are class double size 9x11. Where am i wrong with the dimensions?

  1 Comment
Matt J
Matt J on 14 Mar 2025
Edited: Matt J on 14 Mar 2025
I think we need a smaller scale example (with explicit numbers) to see what you mean.

Sign in to comment.

Answers (1)

Cris LaPierre
Cris LaPierre on 14 Mar 2025
You appear to be using the syntax F = griddedInterpolant(gridVecs,V)
The sample points (dim1, dim2, ...) must be unique and sorted. The vectors must specify a grid that is the same size as V. In other words, size(V) = [length(dim1) length(dim2),...,length(dim6)].
The problem, then, is that concatenating res1...res16 with square brakets does not create 6 dimension array.
If dim1 - dim6 are all 16x1, then V must be an array with dimensions 16x16x16x16x16x16.

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!