3 views

Uploaded by Abhijit Roy

matrix

- The Cow of the Barricades and Other Stories_ Raja Rao as a Short Story Writer
- Curriculum Vitae
- US20060108767_Patent 1
- Lecture 1, PHYSICAL LAW
- Prakhar Hospital Private Limited
- differential equation
- Electrowetting Park Thesis
- Demo pic
- US20070228687A1_vvi
- Short storis
- lens fabrication
- Abhijit_GYTI
- Only as Good as Their Telescopes
- Chain Less
- diagram
- Stock Register
- chnl g
- Optochemoptochem
- Lists of items
- A Comprehensive Report

You are on page 1of 2

For the given matrix equation:

Ax=b

Now A and b can be input as:

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

>> b = [8; 9; 3]

Example 1

Let us first enter some matrices into MATLAB:

>> A = [1, 2, 3, 4; 5, 6, 7, 8]

>> B = [8, 7, 6, 5; 4, 3, 2, 1]

We can add them by typing

>> A+B

ans =

9 9 9 9

9 9 9 9

Example 2

Enter the following matrices into MATLAB:

>> A = [1, 1; 1, 0]

>> B = [0, 1; 1, 1]

Now multiply them, simply by typing

>> A*B

ans =

1 2

0 1

What happens if we multiply B by A?

>> B*A

ans =

1 0

2 1

When you multiply two matrices A and B, it is often not true that AB = BA!

>> A-B

>> 2*A

>> A^3

(Multiplies matrix A by a scalar 2.)

(Raises the matrix A to the third power, i.e., multiplies A by itself three times.)

(Multiplies the corresponding entries of the matrices together. We will not be using this command,

>> A.*B

but it is nice to know.)

>> rref(A) (Gives the reduced row echelon form of A.)

>> A'

(Gives the transpose of A, sometimes written as AT)

EXAMPLE 3

(a) Consider the system of equations:

2x1 + x2 + 5x3 = -1

x1 + 6x3 = 2

-6x1 + 2x2 + 4x3 = 3

On paper, convert this system of equations into a matrix equation of the form Cx = d.

(b) Enter the matrix C and the column vector d into MATLAB, and use the command

>> x = C\d

to check your solution.

(c) We would expect to get the column vector d in MATLAB if we ran the command C*x,

right? In other words, C*x - d should be zero. Enter this equation into MATLAB:

>> C*x-d

What do you get?

- The Cow of the Barricades and Other Stories_ Raja Rao as a Short Story WriterUploaded byAbhijit Roy
- Curriculum VitaeUploaded byAbhijit Roy
- US20060108767_Patent 1Uploaded byAbhijit Roy
- Lecture 1, PHYSICAL LAWUploaded byAbhijit Roy
- Prakhar Hospital Private LimitedUploaded byAbhijit Roy
- differential equationUploaded byAbhijit Roy
- Electrowetting Park ThesisUploaded byAbhijit Roy
- Demo picUploaded byAbhijit Roy
- US20070228687A1_vviUploaded byAbhijit Roy
- Short storisUploaded byAbhijit Roy
- lens fabricationUploaded byAbhijit Roy
- Abhijit_GYTIUploaded byAbhijit Roy
- Only as Good as Their TelescopesUploaded byAbhijit Roy
- Chain LessUploaded byMoHit KuMar
- diagramUploaded byAbhijit Roy
- Stock RegisterUploaded byAbhijit Roy
- chnl gUploaded byAbhijit Roy
- OptochemoptochemUploaded byAbhijit Roy
- Lists of itemsUploaded byAbhijit Roy
- A Comprehensive ReportUploaded byAbhijit Roy
- PresentationUploaded byAbhijit Roy
- biosensorUploaded byAbhijit Roy
- sampleUploaded byAbhijit Roy
- DiagramUploaded byAbhijit Roy
- DiagramUploaded byAbhijit Roy
- Chapter 3Uploaded byAbhijit Roy
- confocalUploaded byAbhijit Roy
- Nanotechnology and Biomimicry UW MRSEC PowerpointUploaded byAbhijit Roy
- Nanotechnology and Biomimicry UW MRSEC PowerpointUploaded byAbhijit Roy