Vector operations, MATLAB in Engineering

Assignment Help:

Vector operations:

As vectors are special cases of matrices, the matrix operations elaborated (addition, subtraction, multiplication, scalar multiplication, transpose) work on vectors and also as the dimensions are right.

For vectors, we know that the transpose of a row vector is the column vector, and the transpose of a column vector is a row vector.

To multiply vectors, they should have similar number of elements, but one should be a row vector and the other a column vector. For illustration, for a column vector c and row vector r:

584_Vector operations.png

Note that r is a 1 × 4, and c is 4 × 1. Recall that to multiply the two matrices,

[A]m ×n [B]n ×p = [C]m × p

Therefore [r] 1×4 [c] 4 × 1 = [s] 1 × 1, or in another word a scalar:

2056_Vector operations1.png

While [c] 4 × 1 [r] 1 × 4 = [M] 4 × 4, or in another words a 4×4 matrix:

1357_Vector operations2.png

In a MATLAB, such operations are accomplished by using the * operator, that is the matrix multiplication operator. At first, the column vector c and row vector r are generated.


>> c = [5 3 7 1]';

>> r = [6 2 3 4];

>> r*c

ans =

         61

>> c*r

ans =

30 10 15 20

18  6  9 12

42 14 21 28

 6  2  3  4


Related Discussions:- Vector operations

True color matrice - image processing, True color matrice: The true co...

True color matrice: The true color matrices are the other way to represent images. The true color matrices are 3-dimensional matrices. The first two coordinates are the coordi

Tracing of square matrices, Tracing of Square matrices: The trace of a...

Tracing of Square matrices: The trace of a square matrix is the addition of all the elements on the diagonal. For illustration, for the preceding matrix it is 1 + 6 + 11 + 16,

Execute a exponential function program, Execute a exponential function prog...

Execute a exponential function program: Running the script will take up the menu as shown in the figure: Then, what happens will totally depend on which button(s) the

Preallocating a vector, Preallocating a Vector: There are necessarily ...

Preallocating a Vector: There are necessarily two programming techniques that can be used to simulate the cumsum function. One technique is to begin with an empty vector and c

Illustration of preallocating a vector, Illustration of Preallocating a Vec...

Illustration of Preallocating a Vector: Illustration of calling the function: >> myveccumsum([5 9 4]) ans =     5  14  18 At the first time in the loop, outvec wil

For loops - iterator variable, For Loops which do not use an iterator Vari...

For Loops which do not use an iterator Variable in the action: In all the illustrations that we seen so far, the value of the loop variable has been used in same way in the ac

Help command, Help command: The help command is used with the script r...

Help command: The help command is used with the script rectarea, the function readlenwid, and the major function printrectarea. To see the first comment in the subfunction, as

Interchange rows - gauss-jordan elimination, Interchange rows : for illust...

Interchange rows : for illustration interchanging rows ri and rj is written as

Illustration of finding a sting, Illustration of finding a sting: Le...

Illustration of finding a sting: Let's enlarge this, and write a script which creates a vector of strings which are phrases. The outcome is not suppressed so that the string

Plotting from a function, Plotting from a Function: The following func...

Plotting from a Function: The following function creates a Figure Window as shown in figure, which shows various types of plots for similar y vector. The vector is passed as a

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd