



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Taylor Series in MATLABThe statementssyms xf = 1/(5+4*cos(x)T = taylor(f,8)return T =1/9+2/81*x2+5/1458*x4+49/131220*x6which is all the terms up to, but not including, order eight in the Taylor series for f(x):Technically, T is a Maclaurin series, since its basepoint is a = 0. The commandpretty(T)prints T in a format resembling typeset mathematics: 2 4 49 61/9 + 2/81 x + 5/1458 x + - x 131220These commands syms xg = exp(x*sin(x)t = taylor(g,12,2);generate the first 12 nonzero terms of the Taylor series for g about x = 2. Next, plot these functions together to see how well this Taylor approximation compares to the actual function g: xd = 1:0.05:3; yd = subs(g,x,xd);ezplot(t, 1,3); hold on;plot(xd, yd, r-.)title(Taylor approximation vs. actual function);legend(Taylor,Function)plot Plot the real-world values of two fi objects against each otherSyntaxplot(a)plot(a,b)plot(a,b,s)plot(a1,b1,s1,a2,b2,s2,.)DescriptionThe plot function for fi objects works the same as the built-in plot function. plot(a) plots the columns of a versus their index. If a is complex, plot(a) is equivalent to plot(real(a),imag(a). In all other uses of plot, the imaginary part is ignored. plot(a,b) plots vector b versus vector a. If a or b is a matrix, then the vector is plotted versus the rows or the columns of the matrix, depending on which matches the dimension of the vector. If a is a scalar and b is a vector, length(b) disconnected points are plotted. You can plot with various line types, plot symbols, and colors using plot(a,b,s) where s is a character string composed of one element from any or all of the three columns in the following table.For example, plot(a,b,c+:) plots a cyan dotted line with a plus symbol at each data point.plot(a,b,bd) plots a blue diamond at each data point, but does not draw any line. plot(a1,b1,s1,a2,b2,s2,.) combines the plots defined by the (a,b,s) triples. For example, plot(a,b,y-,a,b,go) plots the data twice, with a solid yellow line interpolating green circles at the data points.1. 如何设置ezplot函数绘图的颜色h=ezplot(sin(x)set(h,Color,red)2. matlab填充颜色问题h=ezsurf(420-3*x-4*y)/4,50,70); set(h,facecolor,r);hold on; g=ezsurf(300-2*x-3*y)/2,50,70); set(g,facecolor,g)axis equal3. matlab填充颜色问题ezmesh(x2+y2,-2*pi,2*pi, -2*pi,2*pi)colormap(1 0 0)4. 如何将一个图中多个封闭曲线内填充不同的颜色n = 6;r = (0:n)/n;theta = pi*(-n:n)/n;X = r*cos(theta);Y = r*sin(theta);C = r*cos(2*theta);pcolor(X,Y,C)axis equal tight5. matlab中如何对一条曲线和X轴之间的区域进行颜色的填充,比如一个高斯曲线下对应不同X段范围填充不同的颜close allx = 0:0.1:pi;y = sin(x);area(x,y,FaceColor,r);hold onx = pi:0.1:2*pi;y = sin(x);area(x,y,FaceColor,g);x = 2*pi:0.1:3*pi;y = sin(x);area(x,y,FaceColor,b);axis(0,3*pi,-1,1)注意最后x轴坐标一定要设置,否则图像显示不完全。颜色的设置可以自己任意,将b,r等换成a b c格式的RGB色就可以。6. 关于matlab动画的问题h = 500; %h为初始高度x
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024春七年级数学下册 第5章 分式5.5分式方程(1)说课稿(新版)浙教版
- 第二课 学会组装计算机 -认识计算机的各个部件(说课稿)2024-2025学年浙教版(广西、宁波)初中信息技术七年级上册
- 2024秋七年级数学上册 第5章 一元一次方程5.5 应用一元一次方程-希望工程义演 2积分问题与计费问题(利用一元一次方程解计费问题)说课稿(新版)北师大版
- 优化国际供应链管理与物流布局
- 各种段位考试题及答案大全
- 2025财务管理学堂公司员工劳动合同模板
- 产业园供水老旧管网及设施改造工程风险评估报告
- 银粉生产线项目节能评估报告
- 美工基础笔试题及答案
- 磷酸铁锂锂电正极材料生产线项目经济效益和社会效益分析报告
- 大学食品安全主题教育
- 入院患者接待暂空床讲解
- 常用护理质量管理工具
- 中学物理实验室安全管理制度
- 沂沭泗河洪水东调南下续建工程南四湖湖东堤工程施工组织设计
- 制鞋工艺流程
- 土石方工程运输合同
- 国际伤口治疗师汇报
- 《电工基础(第2版)》中职全套教学课件
- 河道清淤与水生态恢复方案
- 2024-2025大学英语考试六级汉译英中英对照
评论
0/150
提交评论