Interpolation with some fix interval

1 回表示 (過去 30 日間)
Aravin
Aravin 2013 年 3 月 12 日
Hi Every body,
I have different vectors whose values are between 0-1. The vectors are of different size. Now I want to fit them in one matrix.
Lets say one vector is of 10 ( a ) elements and second ( b ) is of 60 elements. Now I interpolate the values of vector a to six times and now I can fit both a and b into one matrix. Problem comes when a is of size 19 or 17 and I want to interpolate it upto 60 values. Is it possible ?
For interpolation I am using interp function.

採用された回答

Shashank Prasanna
Shashank Prasanna 2013 年 3 月 12 日
You can do the following using interp1:
a = randn(17,1);% a is some vector with length of 17
l = length(a);
yi = interp1(1:l,a,linspace(1,l,60))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by