数值分析的matlab程序设计

数值分析的matlab程序设计

ID:14101890

大小:353.00 KB

页数:8页

时间:2018-07-26

数值分析的matlab程序设计_第1页
数值分析的matlab程序设计_第2页
数值分析的matlab程序设计_第3页
数值分析的matlab程序设计_第4页
数值分析的matlab程序设计_第5页
资源描述:

《数值分析的matlab程序设计》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、数值分析作业题目利用MATLAB编写数值算法程序班级/学号04140101/20100414028学生姓名张阳指导教师刘勇进一、编写lagrange插值法计算拉氏基函数,再求和。图1拉氏基函数求解流程图Lagrange_base_function.m文件%Copyright(c)2012ShenYangAreospaceUniversity%Allrightsreserved%%filename:Lagrange_base_function.m%summary:%%currentedition:%programmer:YungZhung%accomplishtime:2012

2、-04-15%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%functionname:Lagrange_base_function.m%functiondescribe:%functionindetailed:%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%functionY=Lagrange_base_function(x,k)n=length(x);y=ones(n,2);Y=1;forii=1:ni

3、fii==kcontinue;endy(ii,2)=-x(ii);Y=conv(Y,y(ii,:));endend图2计算lagrange插值函数及差值值Lagrange.m文件%Copyright(c)2012ShenYangAreospaceUniversity%Allrightsreserved%%filename:Lagrange.m%summary:%%currentedition:%programmer:YungZhung%accomplishtime:2012-04-15%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

4、%%%%%%%%%%%%%%%%%%%%%%functionname:Lagrange.m%functiondescribe:%functionindetailed:%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%functionY=Lagrange(x,y,point)ifmin(size(x))>1

5、

6、min(size(y))>1error('themuxtbetwovectors!!!');endn=length(x);ifn~=length(y)error('thedimention

7、ofthetwovectorsmustaggree!!!');endY=0;forii=1:ny_1=Lagrange_base_function(x,ii);Y=polyadd(Y,y(ii)*y_1/polyval(y_1,x(ii)));endifnargin==2disp(Y);elseY=polyval(Y,point);end一、编写复合二重simpson求积公式图3二重复合simpson公式流程图转化为一重simpson求积公式。%Copyright(c)2012ShenYangAreospaceUniversity%Allrightsreserved%%fil

8、ename:simpson_con.m%summary:%%currentedition:%programmer:YungZhung%accomplishtime:2012-06-25%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%functionname:simpson_con.m%functiondescribe:%functionindetailed:%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

9、function[val]=simpson_con(f,a,b,c,d,m,n)ifb

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。