Row interpolation by adding data at end of the matrix

1 view (last 30 days)
I have a variable d which is a row matrix of 1x18
d=[24.1615256950601 24.1615256699363 24.1615256438020 24.1615256182430 24.1615256053197 24.1615255801960 24.1615255672726 24.1615255402679 24.1615255131230 24.1615255004873 24.1615254753636 24.1615254509627 24.1615254248284 24.1615254114699 24.1615253988342 24.1615253870690 24.1615253734228 24.1615253590537]
I want to extend the length of the matrix to 1x20. If I am using interp1 it's showing NAN at pos 19,20.
I want to extend the curve to 20 points how should I do it...???

Accepted Answer

Stephen23
Stephen23 on 31 Jul 2019
>> V = interp1(1:18,d,1:20,'pchip','extrap');
>> V(:)
ans =
24.1615256950601
24.1615256699363
24.1615256438020
24.1615256182430
24.1615256053197
24.1615255801960
24.1615255672726
24.1615255402679
24.1615255131230
24.1615255004873
24.1615254753636
24.1615254509627
24.1615254248284
24.1615254114699
24.1615253988342
24.1615253870690
24.1615253734228
24.1615253590537
24.1615253439804
24.1615253282587

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!