70 likes | 214 Views
Unit 7 Symbolic Processing. 中華技術學院電子系 副教授 蔡樸生 副教授 林盈灝. Algebraic and Math. Operator. syms : Create Symbolic Variables expand : expands the expression by carrying out power simplify : simplifies the expression E factor : factors the expression E >> syms x y >> expand ((x+y)^3)
E N D
Unit 7 Symbolic Processing 中華技術學院電子系 副教授 蔡樸生 副教授 林盈灝
Algebraic and Math. Operator • syms : Create Symbolic Variables • expand : expands the expression by carrying out power • simplify : simplifies the expression E • factor : factors the expression E • >> syms x y • >> expand ((x+y)^3) • >> expand (sin(x+y)) • >> factor(x^2-1)
Algebraic and Math. Operator • >> E1=x^2+5; • >> E2=y^3-2; • >> S1=E1+E2 : S1=x^2+3+y^3 • >> S2=E1*E2 : S2=(x^2+5)*(y^3-2) • >> expand(S2) • >> E3=x^3+2*x^2+5*x+10 • >> S3=E3/E1 • >> simplify(S3)
Evaluating Expressions • subs(E,old,new): To replace old with a numeric value to new in the expression E • ezplot(E,[xmin xmax]) • poly2sym([a,b,c…….],’v’) • >> syms x • >> E=x^2+6*x+7 • >> G=subs(E,x,2) • >> ezplot(E,[-2 6]) • >> poly2sym([2,5,-3],’x’)
Test Your Understanding (I) • Given the expressions: • Find the product E1*E2 and express it in its simplest form • Find the quotient E1/E2 and express it in its simplest form • Evaluate the sum E1+E2 at x=7.1
Differentiation • syms n x y • diff(f(x,y),y,n) :對於f(x,y)中的 y 作偏微 n 次 Integration • int(f(x,y),y,a,b) : 對於f(x,y)由 a 到 b 作定積分
Test Your Understanding (II) • Given that ,use MATLAB to find at x=0.2. • Given that ,use MATLAB to find • Given that ,use MATLAB to find • Use MATLAB to evaluate