Interpolation with some fix interval

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by