MATLAB Answers

Ashok Das
0

Interpolation of matrices corresponding to time vector

Ashok Das
さんによって質問されました 2019 年 6 月 25 日
最新アクティビティ KALYAN ACHARJYA さんによって コメントされました 2019 年 6 月 26 日
I have a vector containing time points, and a cell structure containing matrices as its elements.
I want to interpolate the corresponding matrix for some time point which is not in the time vector. How to do that?
Presentation1.png

  4 件のコメント

Ashok Das
2019 年 6 月 25 日
Consider t = [1, 2, 3] and corresponding cell is A, where
A{1} = [1 1; 1 1] , A{2} = [1 0.9;0.95 .87] , A{3} = [1.1 0.85;0.91 .8].
Now want to find the corresponding matrices at other time points, say for time t_new = [1.2, 2.1, 2.9].
infinity
2019 年 6 月 26 日
Hello,
You could try to look at this
maybe it will help.
Bjorn Gustavsson 2019 年 6 月 26 日
Or, depending on sizes, it might be more efficient to interpolate all matrix components at the same time with interp3, or interpn. The different interpolation functions have slightly different options when it comes to interpolation methods.
HTH

サインイン to comment.

2 件の回答

Andrei Bobrov
回答者: Andrei Bobrov
2019 年 6 月 26 日
 採用された回答

Variant with interp1:
t = [1, 2, 3];
A = {[1, 1; 1, 1] ,[1, 0.9;0.95, .87] , [1.1, 0.85;0.91, .8]};
tt = [1.2, 2.1, 2.9];
out = interp1(t(:),permute(cat(3,A{:}),[3,2,1]),tt);
out = permute(out,3:-1:1);

  2 件のコメント

Ashok Das
2019 年 6 月 26 日
Thank you for yor reply. Can you please elaborate the code a bit. It will be reallly helpfull.
KALYAN ACHARJYA 2019 年 6 月 26 日
The answered is already provided by @Andrei, Hello @Ashok, please accept the answer to give due credit to the answer provider.

サインイン to comment.


Vismay Raj
回答者: Vismay Raj
2019 年 6 月 26 日

  0 件のコメント

サインイン to comment.



Translated by