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
  • 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)

  • 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. Σ

  • 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

  • Please help me in thsi question i have only 30 minutes this is python Question Two....

    Please help me in thsi question i have only 30 minutes this is python Question Two. 25 points. Write the missing function such that when the following code executes: import numpy as np # Assume the user enters a valid integer #Assume the user enters o valid integer rows - intinput("Enter number of rows (1-10 ")) inti nputl Enter number of columns 1-10 : columns matrix np.random.randint(1, 11, rows columns).reshapelrows, columns) print"Matrix Shape:" matrix.shape, "MatrixIn". matrix) result sum _border(matrix) print/"The...

  • 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...

  • show all work please be clear and show all steps thank you Use power series to...

    show all work please be clear and show all steps thank you Use power series to represent the functions: a) f(x) = 1 + 24 ( See ex. 6-3) b) 962) = ( p538 ) 7 Use properties of power series to represent the function f(x) = 2 Hint use tal above 1+24 can use the book , clan notes

  • Could you please help me by providing a clear and detailed worked solution for the following prob...

    Could you please help me by providing a clear and detailed worked solution for the following problems. Please only answer if you are have neat had writing that is clear and readable. I will leave feedback that reflects the quality of your response. Thank you 3) Determine which of me folloning diff eenticl equarhions are seporable. in cech case exphin why ne differential equotion is or is not separable If separable, ind me general Soluhion tohe differential equathon. Substitutc me...

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