## Math 314, Linear Algebra

The main class page.

### Row Operations in Matlab

Matlab is not really designed to to do something as basic as row operations. But you can make it do so and learn some Matlab notation along the way.

I am assuming you can get Matlab started up, with or without the fancy graphical interface. It is often much faster without. On a Windows machine, in a lab where Matlab is installed, you use the start menu as for any program

From my linux machine at home, I can connect with ssh tloring@linux.unm.edu and tell the machine what terminal type I am using and then invoke Matlab with the command matlab. (Lower case.)

In the command window, you can enter a matrix as follows:

A = [1 2 3; 0 1 0; 1 1 1]

and Matlab responds basically with

A =

1 2 3

0 1 0

1 1 1

You enter row by row, separating rows with semicolons. Between row elements, you can use spaces or commas.

To dive in and get answers, you have

inv(A)

and

det(A)

Without explanation, here is what you can type in to make Matlab do elementary row operations.

Type I, say R1 <---> R3

A([1 3],:) = A([3 1],:)

Type II, say 2R3 ---> R3

A(3,:) = 2*A(3,:)

Type III, say R1 + 5R2 ---> R1

A(1,:) = A(1,:) + 5*A(2,:)