a. Sort each column and store the result in an arrayB. b. Sort each row and stor
ID: 1890961 • Letter: A
Question
a. Sort each column and store the result in an arrayB.
b. Sort each row and store the result in an array C.
c. Add each column and store the result inan array D.
d.Add each row and store the result in an array E.
Please post the matlab commands and the answers to those commands
a. Sort each column and store the result in an arrayB. b. Sort each row and store the result in an array C. c. Add each column and store the result inan array D. d.Add each row and store the result in an array E. Please post the matlab commands and the answers to those commandsExplanation / Answer
B = sum(A) B = sum(A,dim) B = sum(..., 'double') B = sum(..., dim,'double') B = sum(..., 'native') B = sum(..., dim,'native') M = 8 1 6 3 5 7 4 9 2 This is called a magic square because the sums of the elements in each column are the same. sum(M) ans = 15 15 15 The sums of the elements in each row are also the same. You can sum the elements in each row by transposing M or by using the dim argument. Transposing M: sum(M') ans = 15 15 15 Using the dim argument: sum(M,2) ans = 15 15 15
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.