Signals.and.Systems.with.MATLAB.Computing.and.Simulink.Modeling.4th_Part72

Signals.and.Systems.with.MATLAB.Computing.and.Simulink.Modeling.4th_Part72

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Multiplication, Division, and Exponentiation Signals and Systems with MATLAB Computing and Simulink Modeling, Fourth Edition A 19 Copyright © Orchard Publications In Section A.2, the arrays , such a those that contained the coefficients of polynomi- als, consisted of one row and multiple columns, and thus are called row vectors . If an array has one column and multiple rows, it is called a column vector . We recall that the elements of a row vector are separated by spaces. To distinguish between row and column vectors, the elements of a column vector must be separated by semicolons. An easier way to construct a column vector, is to write it first as a row vector, and then transpose it into a column vector. MATLAB uses the single quotation character ( ) to transpose a vector. Thus, a column vector can be written either as b=[ 1; 3; 6; 11] or as b=[ 1 3 6 11]' As shown below, MATLAB produces the same display with either format. b=[ 1; 3; 6; 11] b = -1 3 6 11 b=[ 1 3 6 11]' % Observe the single quotation character (‘) b = -1 3 6 11 We will now define Matrix Multiplication and Element by Element multiplication. 1 . Matrix Multiplication (multiplication of row by column vectors) Let and be two vectors. We observe that is defined as a row vector whereas is defined as a col- umn vector, as indicated by the transpose operator ( ). Here, multiplication of the row vector by the column vector , is performed with the matrix multiplication operator (*). Then, (A.5) a b c [] A a 1 a 2 a 3 a n = B b 1 b 2 b 3 b n ' = AB A*B a 1 b 1 a 2 b 2 a 3 b 3 a n b n +++ + gle value sin ==
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Appendix A Introduction to MATLAB® A 20 Signals and Systems with MATLAB Computing and Simulink Modeling, Fourth Edition Copyright © Orchard Publications For example, if and the matrix multiplication produces the single value 68, that is, and this is verified with the MATLAB script A=[1 2 3 4 5]; B=[ 2 6 3 8 7]'; A*B % Observe transpose operator (‘) in B ans = 68 Now, let us suppose that both and are row vectors, and we attempt to perform a row by row multiplication with the following MATLAB statements. A=[1 2 3 4 5]; B=[ 2 6 3 8 7]; A*B % No transpose operator (‘) here When these statements are executed, MATLAB displays the following message: ??? Error using ==> * Inner matrix dimensions must agree. Here, because we have used the matrix multiplication operator (*) in A*B , MATLAB expects vector to be a column vector, not a row vector. It recognizes that is a row vector, and warns us that we cannot perform this multiplication using the matrix multiplication operator (*). Accordingly, we must perform this type of multiplication with a different operator. This operator is defined below.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/20/2009 for the course EE EE 102 taught by Professor Bar during the Fall '09 term at UCLA.

Page1 / 8

Signals.and.Systems.with.MATLAB.Computing.and.Simulink.Modeling.4th_Part72

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online