next up previous
Next: Simple Matrix Processing Up: Introduction to Matlab - Previous: Going beyond this tutorial


Matrix Manipulation

How many times have you felt really irritated when you had to process matrices as 2-d arrays or the like. Worse to add two matrices, you needed a double for loop and even worse, to multiply two matrices you needed a triple for loop [2] like this:
  for (i=0; i < n; i++) {
    for (j=0; j < n; j++) {
      for (k=0; k < n; k++) {
	C[i][j] += A[i][k] * B[k][j];	
      }
    }
  }
Now would it not be nice to do something like use a simple `*' operator to multiply two matrices? That's exactly the kinda functionality Matlab provides for matrix manipulation. Computing inverse, transpose, eigen values of matrices is all easy to do using Matlab functions. The following two subsections explain some of these functions.



Subsections
next up previous
Next: Simple Matrix Processing Up: Introduction to Matlab - Previous: Going beyond this tutorial
Arvind Gopu 2006-03-24