# Row interpolation by adding data at end of the matrix

1 view (last 30 days)
Abhiraj Gupta on 31 Jul 2019
Commented: Abhiraj Gupta on 31 Jul 2019
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...???
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Accepted Answer

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
##### 1 CommentShowHide None
Abhiraj Gupta on 31 Jul 2019
Thank you very much for the help.

Sign in to comment.

R2019a

### Community Treasure Hunt

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

Start Hunting!