Matrix calculator

Hossein
2015-12-24

Introduction

  • The “Matrix Calculator” is an application that can help us to calculate the most famous Algebraic operations on matrices. By “Matrix Calculator” you can calculate the determinant,trace,eigenvalues and the transpose of a matrix.

Features

  • This application puts together the most famous algebraic operations in one single app.
  • It is so easy to use.
  • You can choose different dimension for your matrix.
  • You can change your matrix and resume your calculation without reloading the webpage.
  • code for this application is so easy to undrestand and modify.

Mathematical background and codes

  • The determinant of a matrix is the linear expansion of its cofactors along a row or column of that matrix. For more information please visit: https://en.wikipedia.org/wiki/Determinant

  • The trace of a matrix is the summation of the entries in the main diagonal.

  • To calculate the determinant, just plug the matrix into \( det() \) and to calculate the trace, add the entries in the main diagonal:

A=rbind(c(1,2,0),c(-3,2,1),c(1,2,1))
paste("The determinant is ",det(A))
[1] "The determinant is  8"
paste("The trace is  ",A[1,1]+A[2,2]+A[3,3])
[1] "The trace is   4"

Mathematical background and codes

  • The eigenvalues of a matrix are the roots of the charectristic polynomial of that matrix. For more information please visit: http://mathworld.wolfram.com/Eigenvalue.html
  • The transpose of a matrix is another matrix created by reflecting A over its main diagonal.
  • To calculate the eigenvalues and transpose of a matrix in R, just plug the matrix into \( eigen() \) and \( t() \) functions:
cat("the eigenvalues are", eigen(A)[[1]])
the eigenvalues are 1.233412+1.92266i 1.233412-1.92266i 1.533177+0i
t(A)
     [,1] [,2] [,3]
[1,]    1   -3    1
[2,]    2    2    2
[3,]    0    1    1

How To Use and modify?

  • “Matrix Calculator” application is easy to use. Just choose the dimension of your matrix, choose the operation you want to apply, input your matrix and click \( calculate \) button. The result will show up under \( calculate \) button.

  • The code is so easy to modify. You can add other algebraic operations simply by copy/paste the codes and using appropriate build-in functions.

  • You can find the code for this appliction on:
    https://github.com/Hossein-Taghinejad/Matrix-Calculator