实验八 MATLAB7.0符号运算(II).docVIP

  • 27
  • 0
  • 约 8页
  • 2016-12-29 发布于贵州
  • 举报
实验八 MATLAB7.0符号运算(II) 实验目的: ① 掌握MATLAB7.0subs、simple、simplify等函数的应用; ② 掌握利用MATLAB7.0计算极限和级数的方法,计算复合函数的方法; ③了解利用MATLAB7.0计算taylor级数、Fourier变换和Laplace变换的方法。 实验要求:给出程序和实验结果。 实验内容: 一、指出下面各条语句的输出结果 f=sym(2*u); subs(f,u,2) f2=subs(f,u,u+2) a=3; subs(f2,u,a+2) subs(f2,u,a+2) syms x y f3=subs(f,u,x+y) subs(f3,[x,y],[1,2]) subs(f3,[x,y],[x+y,x+y]) 二、简化 三、计算 和 四、1 计算级数 及其前100项的部分和; 1589508694133037873112297928517553859702383498543709859889432834803818131090369901/972186144434381030589657976672623144161975583995746241782720354705517986165248000 2 计算函数级数 五、(1)设求复合函数 f(g(z)); (2)设求复合函数 f(g(z))。 六、设a、b定义如下,试上机输出factor(a)和factor(b)的结果,并指出那个结果才是12345678901234567890的因式分解,为什么? a=sym(12345678901234567890); b=sym(12345678901234567890); 所以第一种是。利用simplify函数,它有简化的作用,从而可以直观的看出第一个结果是。 七、替换函数subs的使用。 (1)试指出下面程序中的f1、f2、f3、f4、f5的值。 syms a x; f=a*sin(x)+5; f1=subs(f,sin(x),sym(y)) f2=subs(f,{a,x},{2,sym(pi/3)}) f3=subs(f,{a,x},{2,pi/3}) f4=subs(subs(f,a,2),x,0:pi/6:pi) f5=subs(f,{a,x},{0:6,0:pi/6:pi}) (2)试指出下面替换的结果,并说明理由。 syms x y; f=2*x+y; subs(f,{x,y},{x+y,x-y}) 原因:subs(S,old,new) replaces old with new in the symbolic expression S. old is a symbolic variable or a string representing a variable name. new is a symbolic or numeric variable or expression. If old and new are cell arrays of the same size, each element of old is replaced by the corresponding element of new. If S and old are scalars and new is an array or cell array, the scalars are expanded to produce an array result. If new is a cell array of numeric matrices, the substitutions are performed elementwise (i.e., subs(x*y,{x,y},{A,B}) returns A.*B when A and B are numeric). If subs(s,old,new) does not change s, subs(s,new,old)is tried. This provides backwards compatibility with previous versions and eliminates the need to remember the order of the arguments. subs(s,old,new) does not switch the arguments if s does not change 八、计算sin(

文档评论(0)

1亿VIP精品文档

相关文档