教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 高等教育 >

Matlab与数学建模综合练习(9)

来源:网络收集 时间:2026-09-08
导读: >> [p,s]=polyfit(x,y,1) p = 1.3538 47.2362 s = R: [2x2 double] df: 5 normr: 20.8486 所以回归方程为:y=1.3538x+47.2362; 10.假如你有一组实测数据,例如: x=[75 86 95 108 112 116 135 151 155 160 163 167

>> [p,s]=polyfit(x,y,1) p =

1.3538 47.2362 s =

R: [2x2 double] df: 5 normr: 20.8486

所以回归方程为:y=1.3538x+47.2362; 10.假如你有一组实测数据,例如:

x=[75 86 95 108 112 116 135 151 155 160 163 167 171 178 185]; y=[10 12 15 17 20 22 35 41 48 50 51 54 59 66 75]; 求其回归直线,画回归直线图形并计算最小误差平方和.

>> x=[75 86 95 108 112 116 135 151 155 160 163 167 171 178 185]; >> y=[10 12 15 17 20 22 35 41 48 50 51 54 59 66 75];

- 26 -

>> plot(x,y)

>> [p,s]=polyfit(x,y,1) p =

0.5805 -41.2700 s =

R: [2x2 double] df: 13 normr: 16.2044

所以回归方程为: y=0.5805x+-41.2700;

12.求下列各结果:

(1)用Matlab因式分解:x>> syms x

- 27 -

100?1.

>> f=x^100-1; >> factor(f) ans =

(x-1)*(x^4+x^3+x^2+x+1)*(x^20+x^15+x^10+x^5+1)*(x+1)*(1-x+x^2-x^3+x^4)*(1-x^5+x^10-x^15+x^20)*(1+x^2)*(x^8-x^6+x^4-x^2+1)*(x^40-x^30+x^20-x^10+1)

(2)用Matlab求极限:L?lim>> syms x

>> f=((1+x)^(1/x)-exp(1))/x; >> L=limit(f,x,0) L = NaN

(3)用Matlab求积分:>> syms x >> f=sin(x^2); >> int(f,x,0,inf) ans =

1/4*2^(1/2)*pi^(1/2)

(4)用Matlab求幂级数:

x?0(1?x)?e.

x1x?0??sinx2dx.

?(?1)n?1?n?1x2n?14n?12的和函数(化简结果).

>> syms x n

>> Fn=(-1)^(n-1)*x^(2*n+1)/(4*n^2-1); >> S=symsum(Fn,n,1,inf) S =

1/3*x^3*(3/2*LerchPhi(-x^2,1,3/2)*(-1/2-1/2*x^2)+1/(x^2+1)*(3/2*x^2+3/2))

14. (三维)符号作图尝试 命令

作用 - 28 -

解释 ezplot3 ezcontour ezcontourf ezmesh ezmeshc ezsurf ezsurfc 3-D parametric curve plotter use contour plotter filled contour plotter 3-D mesh plotter combination mesh/contour plotter 3-D colored surface plotter combination surf/contour plotter 3D参数曲线图形 等高线图 填充等高线图 3D mesh曲面图形 mesh曲面/等高线图 3D surf曲面图形 surf曲面/等高线图 请尝试以下的命令:

ezplot3('sin(t)', ' cos(t)', 't', [0,6*pi])

>> ezplot3('sin(t)', ' cos(t)', 't', [0,6*pi])

ezcontour('x*exp(-x^2 - y^2)')

>> ezcontour('x*exp(-x^2 - y^2)')

- 29 -

ezcontourf('x*exp(-x^2 - y^2)')

>> ezcontourf('x*exp(-x^2 - y^2)')

ezmesh('(s-sin(s))*cos(t)','(1-cos(s))*sin(t)','s',[-2*pi,2*pi])

>> ezmesh('(s-sin(s))*cos(t)','(1-cos(s))*sin(t)','s',[-2*pi,2*pi])

- 30 -

Matlab与数学建模综合练习(9).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/605046.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)