creating new vector that is a combination of two interpolated vectors
Show older comments
Currently I have a vector called A [28 56 84 112 140 168 196 224 252 280 308 336 364 392 420 448 476 504 532 560 588 616 644 672 700 728 756 784 812 840 868 896 924] and another called B that is [82.5 127.5,182.5, 230, 277.5, 330, 380, 432.5, 480, 530, 582.5, 632.5, 682.5, 732.5, 830.5, 882.5 930.5, 980, 1032.5, 1080]
How do I go by interpolating the two vectors such that they will be in units of 1 i.e. [28,29,30…924] for A and [83,84, 85…1080] for B then combining them such that the third new vector will only have points that are common in vector A and vector B after interpolation? After which how would i go about adding zeroes to the end of the third new vector such that it will have the same length as another vector C that is 1xN long?
Accepted Answer
More Answers (1)
i1=ceil(max(A(1),B(1)); % greater of the two start values rounded up
i2=floor(min(A(end),B(end))); % end is minimum of last rounded down
C=[i1:i2]; % the values between the bounds, inclusive
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!