Question

Write a complete set of Matlab instructions that implements cubic spline interpolation on the following data (assume clamped-
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Inorder to calculate the spline interpolation for the given data we can use matlab's interp1 fucntion.

interp1 takes 4 arguments:

1.) x: given x data

2.) y: given y data

3.) xv: range of x to interpolated for. here it is 0 to 5

4.) mode: mode of interpolation. here it is 'spline'

it returns a row vector yv, which contains y values for given xv values

plot x vs y and xv vs yv

program:

x = [0 1 2 3 4 ];

y = [1.7 0.3 1.8 0.4 2];

xv = 0:5;

yv = interp1(x,y,xv,'spline');

plot(x,y,'o',xv,yv,'-.')

output plot:

2.)

  • The same process in the previous question can be used here to find x at 0.5, 0.8 and 3.7
  • In the place of xv argument in interp1() , pass the given values of x.
  • Also, the below program is a continualtion of program in previous question

​​​​​​​program:

y5 = interp1(x,y,0.5,'spline')

y8 = interp1(x,y,0.8,'spline')

y37 = interp1(x,y,3.7,'spline')

outputs:

​​​​​​​

Add a comment
Know the answer?
Add Answer to:
Write a complete set of Matlab instructions that implements cubic spline interpolation on the following data...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT