Question
second picture is output of the mathlab code
Important Note: For testing of this part of the assignment, the automatic printing of values in the com mand window must not
Matrix A: 22 0 12 4 Matrix B 14 4 3 9 Row 1 in matrix A: 220 Column 2 in matrix B: Sum of matrix A: Adding matrices A and B 3
Important Note: For testing of this part of the assignment, the automatic printing of values in the com mand window must not be used. Please make sure you put semicolon ω at the end of each line. For this part your program should perform following tasks 1. Create a Matrix A. Show the contents of matrix A to command window with the title Matrix A:". The Matrix A should be defined as following 22 0 124 2. Create a Matrix B. Show the contents of matrix A to command window with the title "Matrix B: The Matrix B should be defined as following 14 4 -3 9 3. Select row1 in matrix A using colon operator. Show the output to command window with the tle Row 1 in Matrix A: 4. Select column 2 in matrix Busing colon operator. Show the output to command window with the title Column 1 in Matrix B: 5. Use the built-in sum function to find the sum of each row in matrix A Show the result to the com mand window with the title "Sum of matrix A:" 6. Add the matrices A and B. Show the results to the command window with the title "Adding matni ces A and B: 7· Find the Vector (element-by-elernent) multiplication of A and B. Show the results to the command window with the title Vector multiplication of A and B: 8. Find the matrix multiplication of A and B. Show the results to the command window with the title Matrix multiplication of A and B:" 9. Find the matrix multiplication of B and A. Show the results to the command window with the title Matrix multiplication of B and A:" 10. Use the built-in min and max function to find minimum element of matrix A and maximum ele- ment of matrix B for each column. Then create a new matrix that first column is maximum of matrix B and second column is minimum of matrix A Show the result to command windows with the title Matrix from minimum of A and maximum of B:
Matrix A: 22 0 12 4 Matrix B 14 4 3 9 Row 1 in matrix A: 220 Column 2 in matrix B: Sum of matrix A: Adding matrices A and B 36 Vector ultiplication of A and B 308 0 -36 -36 Matrix multiplication of A and B 2 308 88 180 12 Matrix multiplication of B and A 356 16 42 36 Matrix from ninimum of A and maximum of B 12 4
0 0
Add a comment Improve this question Transcribed image text
Answer #1

A = [22 0; 12 4]
B = [14 4; -3 9]
%matrix A
fprintf("Matrix ")
A
%matrix B
fprintf("Matrix ")
B
%matrix A's row1
fprintf("Row 1 in matrix A:")
A(1,:)
%matrix B's column2
fprintf("Column 2 in matrix B:")
B(:,2)
%addition
fprintf("Adding matrix A and B:")
A+B
%vector multiplication
fprintf("Vector multiplication of A and B: ")
A.*B
%Matrix multiplication
fprintf("Matrix multiplication of A and B: ")
A*B
fprintf("Matrix multiplication of B and A: ")
B*A
a=min(A(:,1))
b=min(A(:,2))
c=max(B(:,1))
d=max(B(:,2))
%new matrix
fprintf("Matrix from minimum of A and maximum of B")
newM=[c d; a b]

Add a comment
Know the answer?
Add Answer to:
second picture is output of the mathlab code Important Note: For testing of this part of the assignment, the automatic printing of values in the com mand window must not be used. Please make sure...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • cope the code please thanks Write a MATLAB code to obtain the following. Keep your code...

    cope the code please thanks Write a MATLAB code to obtain the following. Keep your code commented whenever required. Copy your source code and command widow outcomes and screen shots of any plots in your solution. Generate a matrix "A" as follow. A= 16 6 8 2 10 18 12 14 4 I. II. Divide the matrix A by 2 and store the result in a matrix B. Combine matrices A & B to obtain the following matrix C. Also...

  • I need help modifying this program. How would I make sure that the methods is being...

    I need help modifying this program. How would I make sure that the methods is being called and checked in my main method? Here is what the program needs to run as: GDVEGTA GVCEKST The LCS has length 4 The LCS is GVET This is the error that I'm getting: The LCS has length 4 // I got this right The LCS is   //the backtrace is not being called for some reason c++ code: the cpp class: /** * calculate...

  • the picture above is the one you are supposed to use for the MATlab code please...

    the picture above is the one you are supposed to use for the MATlab code please help Problems. Grayscale images are composed of a 2D matrix of light intensities from O (Black) to 255 (White). In this lab you will be using grayscale images and do 2D-array operations along with loops and iflelse branches. 1. We can regard 2D grayscale images as 2D arrays. Now load the provided image of scientists at the Solvay Conference in 1927 using the imread)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT