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

Creating the structure variables, Creating the structure Variables: Cr...

Creating the structure Variables: Creating a structure variable can be accomplished by simply storing the values in fields by using assignment statements, or by using the stru

Sorting vectors of structures, Sorting Vectors of structures: Whenever...

Sorting Vectors of structures: Whenever working with vector of structures, it is very common to sort based on a particular field within the structures. For illustration, recal

Basic mathematical operations, Basic mathematical operations: All the ...

Basic mathematical operations: All the basic mathematical operations can be executed on symbolic expressions and variables (example, add, raise to a power, multiply, subtract,

Illustration of image processing, Illustration of Image processing: Th...

Illustration of Image processing: This displays that there are 64 rows, or in another word, 64 colors, in this specific colormap. It also displays that the first five colors a

Forward elimination, Forward elimination: In forward elimination, we w...

Forward elimination: In forward elimination, we want to obtain a 0 in the a 21 position. To accomplish this, we can alter the second line in the matrix by subtracting from it

Image processing, Image Processing: The Images are represented as grid...

Image Processing: The Images are represented as grids, or matrices, of picture elements (known as pixels). In MATLAB an image usually is represented as a matrix in which each

Frd to ss, I have a frequency response data. How do I convert that to state...

I have a frequency response data. How do I convert that to state space? I am given a 6 row and 3 column data (steady state). How do i convert that to state space model?

Illustration of graphics properties, Illustration of Graphics properties: ...

Illustration of Graphics properties: A particular property can also be exhibited, for illustration, to view the line width:     >> get(hl,'LineWidth')     ans =

Function used in binary search, Function used in binary search: The fu...

Function used in binary search: The function below implements this binary search algorithm. It receives two arguments: the sorted vector and a key (on the other hand, the func

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