正在加载图片...
缺省的独立变量,有时称作自由变量,在表达式’1(5+cos(x)中是'x;在’3y+z中 是’y';在'a+sin(0’是’t'。在表式'sin(pi/4)-cos(3/5)'中自由符号变量是'x’,因为此式 是一个符号常数无符号变量。可利用函数 symvar询问 MATLA B在符号表达式中哪一个变量它 认为是独立变量 >>symvar(a*x+y*)% find the default symbolic variable > symvar(at+s/(u+3))% u is the closest tox > symvar( 'sin(omega))%omega is not a singlee character >>symvar(3*1+4*j)% i and j are equel to sqrt(-1) >>symvar(y+3*s,'t)% find the variable closest to t rather than x 如果利用规则 svmvar不能找到一个缺省独立变量,它便假定无独立变量并返回x。这一结 论对含有由多个字母组成的变量,如: alpha或s2的表达式,或不含变量的符号常数均成立。如 果需要,绝大多数命令都使用用户选项以指定独立变量。 >>diff(xn)% differentiate with respect to the default variable 'x Xn*n/x >diff('xn,'n)% differentiate x n with respect to'n >>diff( ' sin(omega))% differentiate using the default variables(x)缺省的独立变量,有时称作自由变量,在表达式 ' 1/(5+cos(x)) ' 中是 ' x ' ;在 ' 3*y+z ' 中 是 ' y ' ;在 ' a+sin(t) ' 是 ' t ' 。在表式 ' sin(pi/4)-cos(3/5) ' 中自由符号变量是 ' x ' ,因为此式 是一个符号常数无符号变量。可利用函数symvar询问MATLAB在符号表达式中哪一个变量它 认为是独立变量。 >> symvar( ' a*x+y*) % find the default symbolic variable ans= x >> symvar( ' a*t+s/(u+3) ' ) % u is the closest to ' x ' ans= u >> symvar( ' sin(omega) ' ) % ' omega ' is not a singlee character。 ans= x >> symvar( ' 3*i+4*j ' ) % i and j are equel to sqrt(-1) ans= x >> symvar( ' y+3*s ' , ' t ' ) % find the variable closest to t rather than x ans= s 如果利用规则symvar不能找到一个缺省独立变量,它便假定无独立变量并返回x。这一结 论对含有由多个字母组成的变量,如:alpha或s2的表达式,或不含变量的符号常数均成立。如 果需要,绝大多数命令都使用用户选项以指定独立变量。 >> diff( ' x^n ' ) % differentiate with respect to the default variable ' x ' ans= x^n*n/x >> diff( ' x^n ' , ' n ' ) % differentiate x^n with respect to ' n ' ans= x^n*log(x) >> diff( ' sin(omega) ' ) % differentiate using the default variables (x) ans= 0
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有