How to simplify an algebraic formula in MatLab? - simplify -- MatLab

How to simplify an algebraic formula in MatLab? - simplify -- MatLab


[Ans]

simplify command

[Description]

S = simplify(expr) performs algebraic simplification of expr. If expr is a symbolic vector or matrix, this function simplifies each element of expr.

example

S = simplify(expr,Name,Value) performs algebraic simplification of expr using additional options specified by one or more Name,Value pair arguments.


[Syntax]

more details on

 Algebraic simplification - MATLAB simplify (mathworks.com)


[Useful Tips]

sin(x)^2+cos(x)^2==1

log(exp(a))==a

[Code]

clear
clc
syms x c alpha beta
%one formula of triangular function
simplify(sin(x)^2 + cos(x)^2) %1
%formula of exponent function
simplify(exp(c*log(sqrt(alpha+beta)))) %(alpha + beta)^(c/2)
simplify(sqrt(x^2)) %sqrt(x^2)
simplify(sqrt(x^2),'IgnoreAnalyticConstraints',true) %x
u = symunit;
simplify(u.m+u.mm) %(1001/1000)*[m]

Comments

Popular posts from this blog

How to find all divisors of a number or expression in MatLab? - divisors -- MatLab