Question
In Matlab

Yes or No. Circle them or mark Yes No Given A = eye(4) and B = ones(3), can we perform A+B? Yes No Given A = (2 5 6; 4 1 -4]
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

Two matrices are added when the size of the matricesare equal.

For A = eye(4) It is a 4x4 matrix.

For B = ones(3) It is a 3x3 matrix

>> A=eye(4)

A =

1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

>> B=ones(3)

B =

1 1 1
1 1 1
1 1 1

>> A+B
Matrix dimensions must agree.

No - We can not perform A+B.

-------------------------------------------------------------

A =

2 5 6
4 1 -4

>> B=[-2 3;4 7;1 0]

B =

-2 3
4 7
1 0

>> A*B

ans =

22 41
-8 19

We can perform A*B because the dimension of A is 2x3 and dimension of B is 3x2 and the resultant matrix = 2x2.

YES - We can perform A*B.

----------------------------------------------------

Inmatla all comments are preceded by %

No - All comments are preceded by $

-------------------------------------------------------------

YES - In matlab, semicolon is used to supress the outut.

-----------------------------------------------------

No- In matlab, semicolon is used to indicate end of the column.

-----------------------------------------------------

NO- subplot(2,2,5) is not a valid command because the index 5 exceeds the number 2x2 =4

---------------------------------------------------

No- x6 is the invalid command

---------------------------------------------------------

To compare matrices, the two should be the same size.

No

-----------------------------------------------------

YES - in arraycomparision, the answer is either 0 or 1.

---------------------------------------------------

No- In matlab, it is required tindicate the data array.

Add a comment
Know the answer?
Add Answer to:
In Matlab Yes or No. Circle them or mark Yes No Given A = eye(4) and...
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
  • on matlab (1) Matrices are entered row-wise. Row commas. Enter 1 2 3 (2) Element A,...

    on matlab (1) Matrices are entered row-wise. Row commas. Enter 1 2 3 (2) Element A, of matrix A is accesser (3) Correcting an entry is easy to (4) Any submatrix of Ais obtained by d row wise. Rows are separated by semicolons and columns are separated by spaces ner A l 23:45 6. B and hit the return/enter kry matrix A is accessed as A Enter and hit the returnerter key an entry is easy through indesine Enter 19...

  • matlab( answer the question in matlab) show the full answer with comment please. W a rnction...

    matlab( answer the question in matlab) show the full answer with comment please. W a rnction to find the largest product of adjacent number pairs in a matrix, where pair combinations can be selected the horsonal accent or vertically adjacent (but not diagonally adjacent) of numbers in a matrix are accent if they are in the same row or column and located next to each other when the 2D matrix is displayed The largest product of a pair of adjacent...

  • Please code in MatLab or Octave Output should match Sample Output in the second picture Thank...

    Please code in MatLab or Octave Output should match Sample Output in the second picture Thank You 4. In this problem we will investigate using loops to calculate the product of two matrices. Given an mxn matrix A and an n x p matrix B, the matrix product C = AB is the m xp matrix with Cij = R=1 Qikbky. Write a program which calls a function get matrix.dimensions which should • print a description of the purpose of...

  • In this exercise you will work with LU factorization of an matrix A. Theory: Any matrix A can be ...

    In this exercise you will work with LU factorization of an matrix A. Theory: Any matrix A can be reduced to an echelon form by using only row replacement and row interchanging operations. Row interchanging is almost always necessary for a computer realization because it reduces the round off errors in calculations - this strategy in computer calculation is called partial pivoting, which refers to selecting for a pivot the largest by absolute value entry in a column. The MATLAB...

  • In this exercise, you will work with a QR factorization of an mxn matrix. We will proceed in the ...

    In this exercise, you will work with a QR factorization of an mxn matrix. We will proceed in the way that is chosen by MATLAB, which is different from the textbook presentation. An mxn matrix A can be presented as a product of a unitary (or orthogonal) mxm matrix Q and an upper-triangular m × n matrix R, that is, A = Q * R . Theory: a square mxm matrix Q is called unitary (or orthogona) if -,or equivalently,...

  • can u please on matlab, i have the solution on paper. [30pts] Write a robust, efficient...

    can u please on matlab, i have the solution on paper. [30pts] Write a robust, efficient MATLAB script to find the eigenvalues and eigenvectors of a 2 x2 matrix input by the user. You should test out your script using the following matrices. 1::)-::) 3 2 3 1 B. 1 2 C 2 3 A- D- 4 1 2 4 4 8 -3 8 You may not use any special MATLAB tools. Instead, work symbolically and derive general expressions for...

  • 4. Write a Matlab code that computes the Reynolds number, discharge coefficient, in the discharge...

    4. Write a Matlab code that computes the Reynolds number, discharge coefficient, in the discharge coefficient, and air flow rate for a given orifice plate geometry an difference. Your code should be able to compute the flow rate (mass and ΔΡ across an orifice plate. You will continue to use your code for the rest example set of data against which you can test your code is provided in from your code must be in the same units as shown...

  • Use the attached Matlab code as a basis to solve the following ordinary differential equation usi...

    Question 1 QUESTION 2 Use the attached Matlab code as a basis to solve the following ordinary differential equation using Euler's method, with timestep of 0.1, from t-0to t-100. d)0) -0 - sin (5vt cos(у Plot y versus t from t=0 to t=100. How many local maxima are on this interval(do not include end points). Be careful to count them all! Answer should be an integer 1 w% Matlab code for the solution of Module 2 3 dt-9.1; %dt is...

  • Matlab help *****CONSTANT***** NUM_MONTHS = 12; FIRST_YEAR = 2013; LAST_YEAR = 2016; %*****...

    matlab help *****CONSTANT***** NUM_MONTHS = 12; FIRST_YEAR = 2013; LAST_YEAR = 2016; %*****INPUT***** months = 1:NUM_MONTHS; years = FIRST_YEAR:LAST_YEAR; % read data file lake_powell = load( 'lake_powell.txt' ); % OR load lake_powell.txt % print with title and year column headings. fprintf(' Lake Powell Water Levels (in feet)\n') fprintf('%8d ', years) fprintf('\n') % print contents of lake_powell for month = 1:NUM_MONTHS fprintf('%9.2f', lake_powell(month,:)) fprintf('\n') end % PART B ========================================================== fprintf('\nPART B: Determine average elevation of water level for each year and...

  • Create a single script (.m file) to complete this assignment. Unless directed otherwise, use meaningful variable...

    Create a single script (.m file) to complete this assignment. Unless directed otherwise, use meaningful variable names for each variable: do not use the default variable ans to store your results. For this assignment do not suppress your output with semi- colons (). Each problem (ie. Problem 1. Problem 2, and Problem 4) should be in a separate cell, using the cell mode feature of MATLAB; the subparts should all be contained in the same cell as the parent problem....

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