Multidimensional interpolation with table data

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일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

Iv
2025년 3월 14일

답변:

2025년 3월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by