Clear Filters
Clear Filters

Interpolation with some fix interval

2 views (last 30 days)
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.

Accepted Answer

Shashank Prasanna
Shashank Prasanna on 12 Mar 2013
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))

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!