【MATLAB】符号数学计算(六):符号函数的操作

一、复合函数的操作

  • compose(f,g):返回复合函数f(g(y)),此处f=f(x),g=g(y);
  • compose(f,g,x,z):返回自变量是z的复合函数f(g(z))
>> syms x y
>> f=sym('x+x^-1');
>> g=sym('sin(x)');
>> h=('1+y^2');
>> compose(f,g)
 
ans =
 
sin(x) + 1/sin(x)
 
>> compose(g,f)
 
ans =
 
sin(x + 1/x)
 
>> compose(f,h,'x','t')
 
ans =
 
1/(t^2 + 1) + t^2 + 1

二、反函数的操作

  • g=finverse(f):返回符号函数f的反函数g。
  • g=finverse(f,v):返回自变量为v的符号函数f的反函数。
>> syms x y
>> f1=sym('1/(sin(x)+cos(x))')
 
f1 =
 
1/(cos(x) + sin(x))
 
>> finverse(f1)
 
ans =
 
-log((2^(1/2)*(x^2*(-2*i) + i)^(1/2) + 1 + i)/(2*x))*i
 
>> f2=sym('x^2+2*x*y+y^2')
 
f2 =
 
x^2 + 2*x*y + y^2
 
>> finverse(f2,y)
 
ans =
 
y^(1/2) - x

猜你喜欢

转载自blog.csdn.net/csdn___csdn/article/details/81158389
今日推荐