To find:
The value of the expressions A.*B, A*B and B*A by hand and then verify the results in MATLAB.
Answer to Problem 2.5P
Solution:
The instruction for the sum of the series
“sum(1./n)”.
Explanation of Solution
The given matrices are,
And,
Substitute
Substitute
Similarly substitute
Now, verifying the expression output by using MATLAB command.
MATLAB Code:
clc
clear all
close all
A = [1 4;3 3]
% Define the command to get the matrix “A”.
B = [1 2;-1 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”.
B*A
% Define the command to get the output of the expression “B*A”.
Save the MATLAB script with name, chapter2_54793_2_5P.m in the current folder. Execute the script by typing the script name at the command window to find the value of the expressions A.*B, A*B and B*A by hand and then verify the results in MATLAB.
Result:
Therefore, the value of the expressions A.*B, A*B, and B*A is
Want to see more full solutions like this?
Chapter 2 Solutions
MATLAB: A Practical Introduction to Programming and Problem Solving
- Algebra for College StudentsAlgebraISBN:9781285195780Author:Jerome E. Kaufmann, Karen L. SchwittersPublisher: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 Learning
- College Algebra (MindTap Course List)AlgebraISBN:9781305652231Author:R. David Gustafson, Jeff HughesPublisher:Cengage LearningAlgebra and Trigonometry (MindTap Course List)AlgebraISBN:9781305071742Author:James Stewart, Lothar Redlin, Saleem WatsonPublisher:Cengage Learning