Question

Please help me with this. PLease make all the steps clear. .........24 Assume a matrix variable mat, as in the following example: ma t = 2 1 2 The following for lo 4 402 op r, size (mat) for i = 1:r sumprint (mat (i, : ) ) end prints this result: The sum is now 15 The sum is now 25 The sum is now 37 Write the function sumprint.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Explanation of Code:

In the first line, we are declaring a matrix(3 X 5)

then [r,c] = size(mat); We are unpacking the values of rows and columns in variables "r" and "c".

then we are initializing our for loop from values 1 to r,

then we are calling sumprint function which is printing the sum of every row of the matrix

sumprint(mat(i,:) , represents that we are accessing "ith" row and all columns of matrix mat

and in the end it is printing the sum of elements of all the rows one by one

Sumprint function is basically accepting a row of matrix(can be considred as a vector) and giving the sum of all its elements.

Add a comment
Know the answer?
Add Answer to:
Please help me with this. PLease make all the steps clear. ......... 24 Assume a matrix...
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
  • How do i find the rel max/min. Please make the steps clear for me to understand....

    How do i find the rel max/min. Please make the steps clear for me to understand. I don't know how to solve for Fx=0 and Fy=0. Thanks 14. f(x, y) = 4x++y2+1

  • please help me and show all the steps and make sure it's correct 8.(a) Show all...

    please help me and show all the steps and make sure it's correct 8.(a) Show all calculus to determine whether the sequence {A,}=1 + 2n converges or diverges. -{{ 2.)"} (b) Show how to find a formula for the sequence of partial sums (Sn) for the 2 infinite sum 2n +51 +6 and use limits to find the sum of the infinite series. Σ

  • Please write neatly and make all of the steps clear. 4. Using alcohols of 6 carbonsor...

    Please write neatly and make all of the steps clear. 4. Using alcohols of 6 carbonsor less, sadium cyanide, carbon dioxide or ethylene oxide as the necessary inorganic r prepare each of the following: steos hink: Witig

  • In this assignment, you are asked to: 1. create a Matrix class that stores and operate...

    In this assignment, you are asked to: 1. create a Matrix class that stores and operate on a dynamic two-dimensional array. The class has the following structure: Private member variables: - int ** mat; - int rows; - int cols; Public member functions: +Default constructor: sets both rows and cols to 3 and creates 3x3 matrix dynamically +Parameterized constructor: sets the rows and cols to the values passed to the constructor and create a matrix with the given dimensions. +Destructor:...

  • please help me , show all steps , please make your font clear.. Problem 1: A...

    please help me , show all steps , please make your font clear.. Problem 1: A project to move packed earth requires you to decide whether to use a dozer/scraper operation or excavator/truck operation. Determine the most economical operation based on the dozer/scraper operation estimated at S6.25/lcy All equipment carries a rated heaped capacity, has a fill factor of 105%, and works 45-min hours. Excavators costs $95/hr (including operator), cycle time is 0.28 min, and bucket heaped capacity is 3...

  • please show the steps and please make sure the solution readable and clear. please be careful...

    please show the steps and please make sure the solution readable and clear. please be careful about this. best regards. A combinational circuit with four inputs (A,B,C,D) and one output (Z) is designed as follows using an 8:1 multiplexer. Inputs A, B, C are connected to the select lines S2,S1,S, respectively. Multiplexer has the following values connected to the data inputs: 10.14 =D; 1, is = 0; 12,1 = 1; h 13,1, =D For the circuit given above a) Fill...

  • Please help me to solve these questions. Exercise 4: Try to solve this questions! Using Matrix...

    Please help me to solve these questions. Exercise 4: Try to solve this questions! Using Matrix A, diagonalize the matrix by following the steps in (a) and (b). TO 0 0] A = 0 3 2 LO 0 1) a. Find the eigenvectors given by the corresponding eigenvalues, 2= 0, 1=1, q=3 (9 Marks) b. Construct matrix P from the eigenvectors and find the corresponding diagonal matrix, D given D = P-1AP (3 Marks)

  • Hi, Can you please help me with this question? I want clear detailed steps please. Thanks!...

    Hi, Can you please help me with this question? I want clear detailed steps please. Thanks! :)​ The system shown below is in static equilibrium. The us between the two masses is the same as the As between the bigger mass and the floor. If F = 20 N and m = 2 kg, what is the coefficient of static friction? (5 mark) 2mF

  • Hello, can someone please help me with this question. Please include all steps to make sure...

    Hello, can someone please help me with this question. Please include all steps to make sure I comprehend the solution. Thank You!! 1. ) A no-name brand cola contains 7g of CO2 dissolved in 0.9 L of the soft drink. If the evaporating CO2 is trapped in a glass cylinder at 1 atm and 250C, what volume would the gas occupy?

  • please help me and show all the steps and make sure it's correct [10pts.) 5. Find...

    please help me and show all the steps and make sure it's correct [10pts.) 5. Find dy and the equation of the tangent line at the point (x,y)=(-2, 0) on the curve r = 21-sin(@)). Include a graph of the polar curve with the orienation indicated. dx [10 pts.) 6. Graph the polar equations r = 5 cos(30) and r = 3cos() for --/2S15 /2. Label any key points needed to find the area that lies in the common interior...

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