Vector operations, MATLAB in Engineering

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

Posted Date: 10/22/2012 2:35:20 AM | Location : United States







Related Discussions:- Vector operations, Assignment Help, Ask Question on Vector operations, Get Answer, Expert's Help, Vector operations Discussions

Write discussion on Vector operations
Your posts are moderated
Related Questions
Gauss Elimination: The Gauss elimination technique consists of:    Generating the augmented matrix [A b]    Applying EROs to augmented matrix to obtain an upper trian

Defined a variable in work space: The variables defined in the script will become a part of the workspace: >> clear >> who >> mysummfile    15 >> who

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

deblank function: The deblank function eliminates only trailing blanks from the string, not leading the blanks. The strtrim function will eliminate both the leading and traili

Evaluating a string: The function eval is used to compute a string as a function. For illustration, below is the string 'plot(x)'is interpreted to be a call to plot the functi

Converting between the String and Number types: The MATLAB has many functions which convert numbers to strings in which each character element is a separate digit, and vice ve

Function call: In the function call, not any arguments are passed so there are no input arguments in the function header. The function returns an output argument, therefore th

Q.1: Consider the transmission of a sinusoid x(t) = cos(2f0t) through a channel a ected by multipath and Doppler. Let there be two paths, and assume the sinusoid is being sent fro

Splits a string : The strtok function splits a string into pieces; it can be called in many ways. The function receives one string as an input argument. It appears for the fir

Displaying expressions: The good-looking function will show such expressions by using exponents; for illustration, >> b = sym('x^2') b = x^2 >> pretty(b)