Question
matlab

D [10 pts Consider following data points Groups a) Use linear interpolation method to fit data. Use interp1 b) Fit data with
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

clear all
close all
clc
x=0:5;
y=[1,-0.6242,-1.4707,3.2406,-0.7366,-6.3717];
xx=0:0.01:5;
yy=interp1(x,y,xx);
figure;
plot(xx,yy,x,y,'o');
title('Linear fit');
yy=spline(x,y,xx);
figure;
plot(xx,yy,x,y,'o');
title('Spline fit');
C=polyfit(x,y,4);
yy=polyval(C,xx);
figure;
plot(xx,yy,x,y,'o');
title('4th order fit');

MATLAB R2018a EDITOR Figure ② ▼| rch Documentation Log In naertfEile Edit View Insert Iools Desktop Wndow Help Find Files Com

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
matlab D [10 pts Consider following data points Groups a) Use linear interpolation method to fit...
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