b.tech 4cse- matlab exp-01 PDF

Title b.tech 4cse- matlab exp-01
Author Saurabh Kumar
Course B.tech
Institution Amity University
Pages 5
File Size 228.6 KB
File Type PDF
Total Downloads 38
Total Views 160

Summary

matlab exp-01. creating and performing various operation on matrix....


Description

EXPERIMENT NO.1 Date:14/01/2019

Aim :- Creating a 1-D array and 2-D array(row/column vector) and then performing a) Arithmetic Operations – Addition, Subtraction, Multiplication, Exponentiation b) Matrix Operations – Inverse, Transpose, Rank with plots.

Tool Used :- MATLAB R2018a Theory :MATLAB allows two different types of arithmetic operations – Matrix arithmetic operations Array arithmetic operations

Matrix arithmetic operations are same as defined in linear algebra. Array operations are executed element by element, both on one dimensional and multi-dimensional array.

Arithmetic Operators: Addition (+): Addition or unary plus. A+B adds the values stored in variables A and B. A and B must have the same size. Subtraction (-): Subtraction or unary minus. A-B subtracts the value of B from A. A and B must have the same size.

Matrix Multiplication (*): Matrix multiplication. C = A*B is the linear algebraic product of the matrices A and B. For non-scalar A and B, the number of columns of A must be equal to the columns of B.

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.

Inverse: A matrix X is invertible if there exists a matrix Y of the same size such that XY=YX. The matrix Y is called the inverse of X. Transpose: B = A.' returns the non-conjugate transpose of A, that is, interchanges the row and column index for each element. Rank: The number of linearly independent columns in a matrix is the rank of the matrix. The rank gives a measure of the dimension of the range or column space of the matrix, which is the collection of all linear combinations of the columns.

Commands: Clc - Clears command windows Clear all - Deletes variables, scripts in workspace.

Program :Clc Clear all

Creating 1D arrays a= [20 40 60] b= [10 30 50] c= [100; 200; 300]

Addition of 1D arrays Sum=a+b

Subtraction of 1D arrays Sub=a-b

Multiplication of 1D arrays Mul=a*c

Array element multiplication Element mul=a.*b

Exponentiation of a matrix expo_a=exp (a)

Creating 2D arrays a2= [1 2 1; 9 8 7; 4 5 6] b2= [1 1 1; 3 3 3; 5 5 5]

Addition of 2D arrays sum2=a2+b2

Subtraction of 2D arrays sub2=a2-b2

Multiplication of 2D arrays mul2=a2*b2

Inverse of Matrix inverse_a2=inv (a2)

Transpose of Matrix transpose_a2=transpose (a2)

Rank of Matrix rank_a2=rank (a2)

Observation :-...


Similar Free PDFs