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
Built-in colormaps: The MATLAB has numerous built-in colormaps which are named; the reference page on colormap shows them. Calling the function colormap without passing any ar

printrectarea function: function call: printrectarea(length, width) function header: function printrectarea(len, wid)   In the function call, there are two argume

FOR Loop: The for loop, or the for statement, is used whenever it is essential to repeat statement(s) in the script or function, and whenever it is known ahead of time how man

Illustration sorting vectors of structures: This function sorts the structures depend only on the price field. A more common function is shown next, that receives a string whi

function numden: The function numden will return individually the numerator & denominator of a symbolic expression: >> sym(1/3 + 1/2) ans = 5/6 >> [n, d] =

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

Illustration of gauss-jordan: Here's an illustration of performing such substitutions by using MATLAB >> a = [1 3 0; 2 1 3; 4 2 3] a = 1 3 0 2 1 3 4 2

Matrix solutions to systems of the linear algebraic equations: The linear algebraic equation is an equation of the form a 1 x 1 + a 2 x 2 + a 3 x 3    .  .  .  .  a n x n

Function iscellstr - string function: The function iscellstr will return the logical true when a cell array is a cell array of all the strings, or logical false if not. >>

Removing Whitespace Characters: The MATLAB has functions which will eliminate trailing blanks from the end of a string and/or leading blanks from the starting of a string.