Interpolating a whole matrix
古いコメントを表示
I have a (3x3)-matrix whose elements change with time. I store the time in a (n x 1)-array and the matrix in a (n x 3 x 3)-matrix. Now for a Simulink simulation I want to extract the (3 x 3)-matrix through interpolation by the simulation time.
Of course, in principle, I could just create interpolation tables for each element of the (3x3)-matrix and reassemble the outputs to a new (3x3)-matrix but I wonder if there'd be a simpler way.
N. B.: I don't have particular toolboxes.
1 件のコメント
dpb
2014 年 12 月 19 日
...I could just create interpolation tables for each element of the (3x3)-matrix and reassemble the outputs...
If you were to instead store the array as nine columns by length N then interp1 will do each column automagically and since it's a single time slice (I presume) being returned each time a reshape to 3x3 if need shouldn't be too costly.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!