第十八题--插值
Clear["Global`*"]
time = Table[i, {i, 6, 18, 2}] ;
tempIn = {18, 20, 22, 25, 30, 28, 24};
tempOut = {15, 19, 24, 28, 34, 32, 30};
fIn = Interpolation[Transpose[{time, tempIn}], Method -> "Spline"];
fOut = Interpolation[Transpose[{time, tempOut}], Method -> "Spline"];
Plot[fIn[x], {x, 6, 18.5}, PlotLabel -> Style["室内温度", Bold, 20]]~Show~
ListPlot[Table[{x, fIn[x]}, {x, 6.5, 18.5, 2}],
PlotStyle -> {Hue[.3], PointSize[.03]}]
Plot[fOut[x], {x, 6, 18.5},
PlotLabel -> Style["室外温度", Bold, 20]]~Show~
ListPlot[Table[{x, fOut[x]}, {x, 6.5, 18.5, 2}],
PlotStyle -> {Hue[.3], PointSize[.03]}]
- 微信公众号
- 关注微信公众号
- QQ群
- 我们的QQ群号
评论