# Linear Algebra Commands In MatLab®(Illustrated Expression)

In this content of Mechanical Base, we will show some kinds of Linear Algebra commands in Matlab® that will make your linear algebra calculations in Matlab® very easy. It is very important to know these commands in Matlab® coding to do advanced calculations in Matlab® again.

YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!

## Basic Linear Algebraic Commands In Matlab®

inv(a): Taking the inverse of the matrix an in Matlab®.

a’: Taking transpose of the matrix in Matlab®.

det(a): Calculation of determinant of matrix a in Matlab®.

a+b: Addition of same dimension a and b matrices in Matlab®.

a-b: Subtraction of same dimension a and b matrices in Matlab®.

a*b: Multiplication of same dimension a and b matrices in Matlab®.

a/b: If b is a regular square matrix(determinant of this matrix is different from zero), makes a*inv(b) calculation with same dimensioned b.

a.*b: The elements of matrix a and matrix b will be multiplied respectively around them.

a./b: The elements of matrix a and matrix b will be divided respectively around them.

trace(a): Diagonal elements of a matrix will be added in Matlab®.

diag(a): A row vector will be created with diagonal elements of a matrix. Or if “a” is a vector, a matrix that includes diagonal elements of “a” vector will be created in Matlab®.

sum(a): Whole rows of matrix a will be added. If “a” is a vector, the result will be the addition of vector elements.

triu(a): The upper triangle matrix of a matrix will be created in Matlab®.

tril(a): The lower triangle matrix of a matrix will be created in Matlab®.

## Conclusion

Do not forget to leave your comments and questions below about the linear algebra commands in Matlab® below.

If you want further coding examples about linear algebra commands in Matlab®, inform us in the comments.