1 / 4
文档名称:

2011秋 实验报告(5)插值实验(Interpolation).doc

格式:doc   大小:58KB   页数:4页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

2011秋 实验报告(5)插值实验(Interpolation).doc

上传人:mh900965 2018/4/22 文件大小:58 KB

下载得到文件列表

2011秋 实验报告(5)插值实验(Interpolation).doc

相关文档

文档介绍

文档介绍:(1)Write a MATLAB function to perform the Lagrangian form Interpolation.
(2)Write a call back m-file to check the function you write.
解:%函数文件的名字存为LagIn,主要利用了数值逼近中拉格朗日基函数的表达式
function f=LagIn(t,y)
n=length(t);
syms x
w=1;
for j=1:n
w=w*(x-t(j));
end
f=0;
for i=1:n
l(i)=w/subs(diff(w,x,1),x,t(i))/(x-t(i));
f=f+sum(l.*y);
end
f1=simplify(f);
data=input('ÇëÊäÈëÒªÔ¤²âµÄµãµÄºá×ø±ê:');
f=subs(f1,x,data)
In the following table
(saved in the data file named ), X is the Fahrenheit(华氏的) temperature, and Y is the number of times a cricket(蟋蟀) chirps(鸣叫) in one minute.
Make a scatterplot(散点图) of the data.
Interpolate the data with some low order piecewise interpolating polynomials.
Fit the data by using an 18th-degree polynomial that passing through(通过) the data points as an empirical model. Analyze the appropriateness of doing so.
Observation Number
x
y
Observation Number
x
y
1
46
40
11
61
96
2
49
50
12
62
88
3
51
55
13
63
99
4
52
63
14
64
110
5
54
72
15
66
113
6
56
70
16
67
120
7
57
77
17
68
127
8
58
73
18
71
137
9
59
90
19
72
132
10
60
93
20
71
137
解:(1)x=[ 46 49 51 52 54 56 57 58 59 60 61 62 63 64 66 67 68 71 72 71];
y=[ 40 50 55 63 72 70 77 73 90 93 96 88 99 110 113 120 127 137 132 137];
plot(x,y,'o')
title('É¢µãͼ');
xlabel('xÖá');
ylabel('yÖá');
legend