Interpolate 3D Matrix based on frequency values

조회 수: 2 (최근 30일)
Lokeshwaran
Lokeshwaran 2012년 11월 14일
I am using m file for post processing of FEA(Finite Element Analysis) results derived from another software.
In this case I have a (a*1*c) matrix which has to be interpolated based on the third dimension 'c' . In the definition of the matrix dimension, I have assigned the dimension 'c' as just numbers starting from 1 upto the required size.
But the problem now is that the third dimension 'c' is a frequency value ( eg: 100 Hz, 300 Hz, 700 Hz, etc). I have to interpolate the (a*1) values based on the user input frequency (eg: for 250 Hz).
Again this has to be done for a number of values, which I guess can be accomplished with the help of a loop. I have the frequency values defining the dimension 'c' and the user input as a array.
Can anyone help me out with this?
Thank you very much for your time and patience.

채택된 답변

Matt J
Matt J 2012년 11월 14일
use the PERMUTE command to make the array dimensions c x a. Then just use interp1, e.g.,
interp1(frequencies, Matrix_cxa, 250);
  댓글 수: 2
Lokeshwaran
Lokeshwaran 2012년 11월 14일
Thank you very much for your answer. But can you make it clear with an example please?
Matt J
Matt J 2012년 11월 14일
편집: Matt J 2012년 11월 14일
OK. So if you want to interpolate the matrix A below at "row 2.5", you would do
>> A=[4 5 6; 7 8 9; 10 11 12]'
A =
4 7 10
5 8 11
6 9 12
>> interp1([1;2;3],A, 2.5)
ans =
5.5000 8.5000 11.5000

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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