16 views

Uploaded by Sabit Hussain

Attribution Non-Commercial (BY-NC)

- R and Octave
- An Introduction to Linear Algebra
- Linear Algebra Chapter 2- MATRICES
- E. D. Nering-Linear Algebra and Matrix Theory-Wiley (1976).pdf
- syllabus
- Chapter 9
- clab.pdf
- Fast Algorithms for Polynomial Matrix Computations
- grupo 6 (2)
- (1981)Wind Induced Torsional Loads on Structures
- dsp with matlab
- Good Man Intro Return PDF
- MATH_F112
- Further Maths Matrices SAC 2010
- Matrix .pptx
- Chapter 3 diff eq sm
- Algebra Matricial
- Solutions RQFT
- Chapter_09.pdf
- 115A_S_L12

You are on page 1of 9

Group member names: Sabit Hussain Khiyal Hussain Habib-ur-Rehman bsee01093024 bsee01093026 bsee01093109

>>a=zeros(2,2) a= 0 0 0 0

(2) Ones(m,n)

>>b=ones(2,2) b= 1 1 1 1

(3) eye(n)

>>c= eye(4) b= 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

The preceding statements create row vectors. For example >> x = 1:5 x= 1 2 3 4 5

Column vector:

To create a column vector, append the transpose operator to the end of the vector-creating expression >> y = (1:5)' y= 1 2 3 4 5

Vectors:

In MATLAB a vector is a matrix with either one row or one column. The distinction between row vectors and column vectors is essential. Many programming errors are caused by using a row vector where a column vector is required, and vice versa.

MATLAB vectors are used in many situations, e.g., creating x-y plots, that do not fall under the rubric of linear algebra. In these contexts a vector is just a convenient data structure. MATLAB still enforces the rules of linear algebra so paying attention to the details of vector creation and manipulation is always important. Scalars In MATLAB a scalar is a variable with one row and one column. Scalars are the simple variables that we use and manipulate in simple algebraic equations.

Creating scalars

To create a scalar you simply introduce it on the left hand side of an equal sign. >> x = 1; >> y = 2; >> z = x + y;

Scalar operations

MATLAB supports the standard scalar operations using an obvious notation. The following statements demonstrate scalar addition, subtraction, multiplication and division. >> u = 5; >> v = 3; >> w = u + v >> x = u - v >> y = u * v >> z = u/v

A basic introduction to defining and manipulating matrices is given here. It is assumed that you know the basics on how to define and manipulate vectors using matlab.

Defining Matrices

Defining a matrix is similar to defining a vector. To define a matrix, you can treat it like a column of row vectors (note that the spaces are required!): >> A = [ 1 2 3; 3 4 5; 6 7 8] A= 1 3 6 2 4 7 3 5 8

You can also treat it like a row of column vectors: >> B = [ [1 2 3]' [2 4 7]' [3 5 8]']

B= 1 2 3 2 4 7 3 5 8

Array multiplication(.*):

Array multiplication. A.*B is the element-by-element product of the arrays A and B. A and B must have the same size, unless one of them is a scalar. A =1 2 3 456

789; B= 10 20 30 40 50 60 70 80 90

Array right division. A./B is the matrix with elements A(i,j)/B(i,j). A and B must have the same size, unless one of them is a scalar. A = [1 2 3;4 5 6]; B = ones(2, 3); A.\B ans = 1.0000 0.5000 0.3333 0.2500 0.2000 0.1667

Matrix transpose():

Matrix transpose. A' is the linear algebraic transpose of A. For complex matrices, this is the complex conjugate transpose.

A = [1 2 0; 2 5 -1; 4 10 -1] A=

1 2

5 -1

4 10 -1

1 2

5 10

0 -1 -1

Array transpose(.):

Array transpose. A.' is the array transpose of A. For complex matrices, this does not involve conjugation.

A= [1 2 3] A >>A=1 2 3

t= 0:0.01:1; k=1:1:3; x= (1./k)*(sin(2*pi*k*t)); plot (t,x,r); xlabel(----- x-axis time---) ylabel(-----y-axis: function of x---) title(graph of function of x vs time)

- R and OctaveUploaded byHugoAlexanderTorresMantilla
- An Introduction to Linear AlgebraUploaded byFauiqe Yousaf
- Linear Algebra Chapter 2- MATRICESUploaded bydaniel_bashir808
- E. D. Nering-Linear Algebra and Matrix Theory-Wiley (1976).pdfUploaded byJulius
- syllabusUploaded byVijay Sharma
- Chapter 9Uploaded byS.T
- clab.pdfUploaded byMalathi Sankar
- Fast Algorithms for Polynomial Matrix ComputationsUploaded byWei Zhou
- grupo 6 (2)Uploaded bySandra Pizarro
- (1981)Wind Induced Torsional Loads on StructuresUploaded bylufias2009
- dsp with matlabUploaded byPanku Rangaree
- Good Man Intro Return PDFUploaded byclaudioww1
- MATH_F112Uploaded byritik12041998
- Further Maths Matrices SAC 2010Uploaded byJainam11
- Matrix .pptxUploaded byMonower Hossain
- Chapter 3 diff eq smUploaded byfallenskylark
- Algebra MatricialUploaded byFrancis Meza Pantoja
- Solutions RQFTUploaded byLuminita-Mihaela Maxim
- Chapter_09.pdfUploaded bySyed Uzair
- 115A_S_L12Uploaded byXiao Xi
- Algorithms 09 00014Uploaded byCuplis Ae
- Senarai Tugasan TutorialUploaded byNurul Hidayah Husin
- hw5ansUploaded byAshish Bodele
- Practical File 201112Uploaded byIshank Goel
- Matlab Tutorial and Linear Algebra ReviewUploaded byRoihanNst
- Computer Concepts C Programming Dec 2010Uploaded byPrasad C M
- Chapter 10-3.docUploaded byEng-Mohammed Kayed
- matlab-1.docxUploaded byman-895142
- Jlinpro Command Glossary Ver04Uploaded byArmin Nurak
- final exam reviewUploaded byapi-237333666

- Quantum Walking in Curved SpacetimeUploaded byYash
- A Curvature Smoothing Hsieh–Clough–Tocher Element for Yield Design of Reinforced Concrete SlabsUploaded byPhuc Phung
- Time and Western Man - Wyndham LewisUploaded byThe Rearranger
- Introduction to Analytical Methods for Internal Combustion Engine Cam MechanismsUploaded bynadjib62
- SAP2000 v19.2.0 Ultimate 64-bit analysisUploaded byGirish Deshmukh
- Special Paper 1992-95Uploaded byalphamale173
- Lets Learn MathematicsUploaded byamjadullah
- Applied Maths i u v SolutionUploaded byMrityunjoy Dutta
- Vector FittingHeinzelUploaded byFranco Carlos
- j p sinha iitUploaded byShaharukh Nadaf
- shortest path.pdfUploaded byLeena Kiran
- special education lesson plan - why do we need trig pt 2Uploaded byapi-242122700
- Geometry Formulas 2D 3D Perimeter Area VolumeUploaded bypiyush
- PDF - Non Linear Dynamics 1 - Chaos MIT - IndexUploaded byHarsh
- algebra 2 lesson plan 5 1-5 4Uploaded byapi-336571715
- Croce Hegel Dead and AliveUploaded byyakar
- Problem solving methods.pptUploaded bySurendra Gupta
- Poincare 2Uploaded bysomedude111222333
- Field Report RevisedUploaded byjaegerm123
- 2d TransformationUploaded byNivedhaSekar
- Geometric Series Exam QuestionsUploaded byAnonymous X7hAeV90rm
- ISM_T11_C15_B.pdfUploaded byRoger Andres Ordoñez
- Circuit Analysis in S-domainUploaded byshreyas_stinson
- 1009.3638Uploaded byAravindSomu
- Lecture Eight: Facility locationUploaded byRodrigo Rampinelli
- Arithmetic by sandyUploaded bySandeep Satya Hanuman Kolisetty
- ogap add framework 090916Uploaded byapi-341236696
- ProbabilityAndTheLogicOfDeFinettiTrievents_FinalUploaded byAlberto Mario Mura
- LBEMA_xlsUploaded byRuly Irawan
- Probability Theory and Stochastic Processes with ApplicationsUploaded bynogarycms