正在加载图片...
syns X fx^3+6*x^2+11*x-6; horner(f 6+(l+(+x)*x)*x HORNER Horner polynomial representation HORNER(P) transforms the symbolic polynomial P into its Horner, or nested representation 符号表达式的替换( Replacing of symbolic expression) MATLAB的符号数学工具箱提供了两个符号表达式的替换函数 subexpr和subs,可通过符号替换使表达式的输出形式简化。 subexpr函数可将表达式中重复出现的字符串用变量代替。调用格式: IY, SIGMA}= subexpr(S, SIGMA):用变量 SIGMA的值代替符号表达式S 中重复出现的字符串,Y返回替换后的结果 例:求解并化简三次方程x3+ax+1=0的符号解 t=solve( 3+a*x+1=0) Ir,sl= subexpr(t,’s”) [l/6*(-108+12*(12*a^3+81)^(1/2)^(1/3)-2*a/(-108+12*(12*a^3+81)^( 1/2)^(1/3) [-1/12*(-108+12*(12*a^3+81)(1/2)(1/3)+a/(-108+12*(12*a^3+81) (1/2))(1/3)+1/2*i*3^(12)*(1/6*(-108+12*(12*a^3+81)^(1/2)^(1/3)+2 a(-108+12*(12*a^3+81)^(1/2)(1/3)) [-1/12*(-108+12*(12*a^3+81)(1/2)(1/3)+a/(-108+12*(12*a^3+81) (1/2))(1/3)-12*1*3~(112)*(16*(-108+12*(12*a^3+81)^(1/2)^(1/3)+2 a(-108+12*(12*a^3+81)^(1/2)^(1/3) 1/6*s^(1/3)-2*as^(1/3 [-1/12*s^(1/3)+as^(1/3)+12**3^(1/2)*(1/6*^(1/3)+2*a/s^(1/3) [-1/12*s^(1/3)+a/s(1/3)-1/2*i*3^(12)*(116*s^(1/3)+2*a/s^(1/3)syms x f=x^3+6*x^2+11*x-6; horner(f) ans = -6+(11+(6+x)*x)*x HORNER Horner polynomial representation. HORNER(P) transforms the symbolic polynomial P into its Horner, or nested, representation. 2. 符号表达式的替换(Replacing of symbolic expression) MATLAB 的符号数学工具箱提供了两个符号表达式的替换函数 subexpr 和 subs,可通过符号替换使表达式的输出形式简化。 subexpr 函数可将表达式中重复出现的字符串用变量代替。调用格式: [Y,SIGMA]=subexpr(S,SIGMA): 用变量 SIGMA 的值代替符号表达式 S 中重复出现的字符串,Y 返回替换后的结果。 例:求解并化简三次方程 x 3+ax+1=0 的符号解。 t=solve(‘x^3+a*x+1=0’) [r,s]=subexpr(t,’s’) t = [1/6*(-108+12*(12*a^3+81)^(1/2))^(1/3)-2*a/(-108+12*(12*a^3+81)^( 1/2))^(1/3)] [ -1/12*(-108+12*(12*a^3+81)^(1/2))^(1/3)+a/(-108+12*(12*a^3+81)^ (1/2))^(1/3)+1/2*i*3^(1/2)*(1/6*(-108+12*(12*a^3+81)^(1/2))^(1/3)+2 *a/(-108+12*(12*a^3+81)^(1/2))^(1/3))] [ -1/12*(-108+12*(12*a^3+81)^(1/2))^(1/3)+a/(-108+12*(12*a^3+81)^ (1/2))^(1/3)-1/2*i*3^(1/2)*(1/6*(-108+12*(12*a^3+81)^(1/2))^(1/3)+2 *a/(-108+12*(12*a^3+81)^(1/2))^(1/3))] r = [ 1/6*s^(1/3)-2*a/s^(1/3)] [ -1/12*s^(1/3)+a/s^(1/3)+1/2*i*3^(1/2)*(1/6*s^(1/3)+2*a/s^(1/3))] [ -1/12*s^(1/3)+a/s^(1/3)-1/2*i*3^(1/2)*(1/6*s^(1/3)+2*a/s^(1/3))]
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有