A blog to help electrical engineers and students to learn electrical engineering topics. Basic Electrical Engineering, Power Systems, Electrical Machines, tec.. Now special course on MATLAB for Beginners.

Class

Class

Saturday, February 20, 2016

Operations on Matrices and Arrays - MATLAB



Arithmetic operations of scalars are discussed in previous post. Now we will discuss about operations of matrices. All the basic operations on matrices, addition, subtraction, multiplication, division, and exponentiation, can be done in MATLAB. Operations other than addition and subtraction are done in two ways, one way, uses the standard symbols (*, /, and ^) where normal matrix operations are performed and the second way, which is called...

Saturday, February 13, 2016

Indexing and Extracting a Sub-Matrix - MATLAB



Array Indexing Each element in a array (matrix) has an address called index. Index of an element is its position in the array. The index for nth element in a vector x, is x(n). There are two ways to index a particular element in a matrix. The most common way is to specify row and column subscripts, such as, the element of row i and column j of the matrix A is denoted by A(i,j). The first index is the row number and the second index is the column...

Saturday, February 6, 2016

Arrays and Matrices in MATLAB



— MATLAB treats all variables as matrices. For our purposes a matrix can be thought of as an array, in fact, that is how it is stored. —Vectors are special forms of matrices and contain only one row or one column. —Scalars are matrices with only one row and one column. Creating Matrices In MATLAB, a vector is created by assigning the elements of the vector to a variable. This can be done in several ways depending on the source of the...