Multidimensional interpolation with table data

4 次查看(过去 30 天)

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 个评论
Matt J
Matt J 2025-3-14
编辑:Matt J 2025-3-14
I think we need a smaller scale example (with explicit numbers) to see what you mean.

请先登录,再进行评论。

回答(1 个)

Cris LaPierre
Cris LaPierre 2025-3-14
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.

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by