How can I interpolate matrices that are parameter dependent?

1 view (last 30 days)
I would like to find a elegant way of interpolating matrices with parameter dependency. I have 2 matrices and one parameter vector. According to this parameter I would like to find an interpolated matrix.
In Matrixx/XMath you can define parameter dependent matrices (pdm's) and interpolate them according to the parameter value. I would like to be able to achieve this the same way in Matlab.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The ability to use interpolation routines on pdm's or to create pdm's is not available in MATLAB 7.6 (R2008a) and prior versions.
To work around this issue, reshape the matrices and use INTERP1 as follows:
% matrices A90,A100 and A110 that depend on parameter x
A90 = [1 2 3; 4 5 6; 7 8 9]
A100 = A+1
A110 = B+1
% parameter x
x = [90;100;110]
% reshape of matrices A90-110 to combine them in one 2-dim matrix
M = cat(1,reshape(A90,[1 9]),reshape(A100,[1 9]),reshape(A110,[1 9]))
% get the interpolated matrix at x = 95
M95 = reshape(interp1(x,M,95),[3 3])

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!