Concept explainers
To create:
The variables for these two matrices and perform these operations “A+B”, “A-B” and “A.B”.
Answer to Problem 41E
Solution:
The variables for the given two matrices are “A = [1:1:3; 4 -1 6]”, and “B = [2 4 1; -1 3 0]” and the output of these operations “A+B”, “A-B”, and “A.B” are
Explanation of Solution
The given matrices are,
And,
Substitute
Therefore, the elements of the matrix “A+B” are
Substitute
Therefore, the elements of the matrix “A-B” are
Substitute
The multiplication of the matrix is not possible.
Now, verify the expression output through the MATLAB command.
MATLAB Code:
A = [1:1:3; 4 -1 6]
% Define the command to get the matrix “A”.
B = [2 4 1; -1 3 0]
% Define the command to get the matrix “B”.
A+B
% Define the command to get the output of the expression “A+B”.
A-B
% Define the command to get the output of the expression “A-B”.
A.*B
% Define the command to get the output of the expression “A.*B” (values of matrix A is multiplied with all the elements of matrix B).
Save the MATLAB script with name, chapter2_54793_2_41E.m in the current folder. Execute the script by typing the script name at the command window to create the variables for given two matrices and perform the following operations “A+B”, “A-B” and “A.B”.
Result:
Therefore, the variables for the given two matrices are “A = [1:1:3; 4 -1 6]”, and “B = [2 4 1; -1 3 0]” and the output of these operations “A+B”, “A-B”, and “A.B” are
Want to see more full solutions like this?
Chapter 2 Solutions
MATLAB: A Practical Introduction to Programming and Problem Solving
- College Algebra (MindTap Course List)AlgebraISBN:9781305652231Author:R. David Gustafson, Jeff HughesPublisher:Cengage LearningCalculus For The Life SciencesCalculusISBN:9780321964038Author:GREENWELL, Raymond N., RITCHEY, Nathan P., Lial, Margaret L.Publisher:Pearson Addison Wesley,
- Elementary Linear Algebra (MindTap Course List)AlgebraISBN:9781305658004Author:Ron LarsonPublisher:Cengage LearningElements Of Modern AlgebraAlgebraISBN:9781285463230Author:Gilbert, Linda, JimmiePublisher:Cengage Learning,