Ifodalarda qavslarni ochib, ularning hadlarini ixchamlash expand() buyrug’i bilan amalga oshiriladi: >> syms x y z a b c d e >> P=(x+1)*(x-1)*(x^2-x+1)*(x^2+x+1) P = (x+1)*(x-1)*(x^2-x+1)*(x^2+x+1) >> P1=expand(P) P1 =x^6-1 - Ko’phadlarni ko’paytuvchilarga ajratish uchun esa factor()buyrug’idan foydalanamiz. Masalan:
- >> factor(P1)
- ans =(x+1)*(x-1)*(x^2-x+1)*(x^2+x+1)
- >> factor(x^5-x^4-7*x^3+x^2+6*x)
- ans =x*(x-1)*(x-3)*(x+2)*(x+1)
- Ifodalarni soddalashtirish simplify() yoki simple()buyrug’i bilan malga oshiriladi.Masalan:
- >> P2=(cos(x)-sin(x))*(cos(x)+sin(x))
- P2 =(cos(x)-sin(x))*(cos(x)+sin(x))
- >> simplify(P2)
- ans =2*cos(x)^2-1
- Bundan tashqari, ifodalar ustida shakl almashtirishlarda kerak bo’ladigan collect, numden, horner, subexpr, subs kabi bir qator buyruqlari mavjud va uni mustaqil o’rganishni foydalanuvchiga qoldiramiz.
-
Do'stlaringiz bilan baham: |