Question

In: Computer Science

Use MATLAB to nd the products AB and BA for the following matrices:

Use MATLAB to nd the products AB and BA for the following matrices:

Solutions

Expert Solution

Consider the matrices,

The objective is to find the products AB and BA by using MATLAB.

In MATLAB, for defining a matrix the row elements are separated “,” and the next column is generated by “;”.

Input:

>>A = [11, 5; -9, -4];

>>B = [-7 -8; 6, 2];

>>AB=A*B

>>BA=B*A

 

Output:

Hence, obtain

 

In this problem, AB ≠ BA.


In this problem, AB ≠ BA.

Related Solutions

Give the finite-state automaton and the regular grammar for the following: (a) (ab v ba)* v...
Give the finite-state automaton and the regular grammar for the following: (a) (ab v ba)* v (ab)* (b) (11*)*(110 v 01) (c) All strings over {0,1} containing the string 010 (d) All strings over {0,1} which do not contain the string 010
generate the following matrices with given rank and verify with the rank command. Include the Matlab...
generate the following matrices with given rank and verify with the rank command. Include the Matlab sessions in your report as indicated. A) is 8x8 with rank 3. B) is 6x9 with rank 4. C) is 10x7 with rank 5 .
a. Using Matlab scripts create the following matrices (???1 and ???2) ???1 = [ 3 2...
a. Using Matlab scripts create the following matrices (???1 and ???2) ???1 = [ 3 2 −3 6 7 4 3 −6 7 ], ???2 = [ 2 1 7 3 3 9 −6 6 1 ]    b. Write code to add the second row of ???1 to the third row of ???2 and store results in the first row of ???1. c. Write code to add the second column of ???1 with the third column of ???2 and...
Let U = {A ∈ Mat(2; ℚ) : AB = BA for all B ∈ Mat(2;...
Let U = {A ∈ Mat(2; ℚ) : AB = BA for all B ∈ Mat(2; ℚ)}. (i) Show that  U is a subspace of Mat(2; ℚ). (ii) Show that E ∈ Mat(2; ℚ) is a basis of U. (E: identity matrix) (iii) Find the complement for U
create a function in matlab that sums two m x n matrices using nested loops, then...
create a function in matlab that sums two m x n matrices using nested loops, then returns result into a new matrix. Use nesed for loops to add matrices piece by piece. Basically means, dont program simply A+B Function should perform error check to make sure both matrices have same number of rows/ columns.
Need a MATLAB code for LU factorization(both partial and complete pivoting) of 10 random matrices of...
Need a MATLAB code for LU factorization(both partial and complete pivoting) of 10 random matrices of order 5x5. Please do not comment like I don't have computer or I don't know matlab. If you please answer otherwise you can skip.
Balance the following reaction Zn^+2 + Ba ------> Ba^+2 + Zn
Balance the following reaction Zn^+2 + Ba ------> Ba^+2 + Zn
For the following problems, use Octave/Matlab to determine whether the following sets
For the following problems, use Octave/Matlab to determine whether the following sets span \(\mathbb{R}^{3}\). Remember you need to pick an arbitrary element in \(\mathbb{R}^{3}\) and see if you can write it as a linear combination of the set of vectors.For each problem, do the following:1) - Write the row reduced echelon matrix found by Octave.2) - Tell me if this set spans \(\mathbb{R}^{3}\).3) - If this set spans \(\mathbb{R}^{3}\), solve for \(\alpha, \beta, \ldots\) (in other words, tell me how...
(MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) Please complete the following...
(MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) (MATLAB ONLY) Please complete the following Question in MATLAB ASAP, Thanks. :) 2a. Write a function that outputs the amount of freezing point depression (in degrees C) given a mass of magnesium chloride salt and a volume of water. Formula to calculate freezing point depression: ΔT = iKm in which ΔT is the change in temperature in °C, i is the van't Hoff factor, which = 3 for MgCl2 because...
Use MATLAB to figure out the following problem, if you do not know how to use...
Use MATLAB to figure out the following problem, if you do not know how to use MATLAB then please do not answer. Coding is required for the exercise. For f(x) = arctan(x), find its zeros by implimenting Newtons method and the Secant method in Matlab. (Hint: Use Newtons method to calculate x1 for Secant method) Comment all code please since I would like to learn how to do this correctly in MATLAB. Thank you.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT