- Take an odd matrix like 3-by-3
- Access the middle element of the matrix i.e in case of 3-by-3 matrix the index of the particular element is second row, second column.
- Now, sum the elements in its column to it and then subtract the elements in its row to it.
- What's the matrix with updated element.
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers30
Suggested Problems
-
Select every other element of a vector
36313 Solvers
-
Replace NaNs with the number that appears to its left in the row.
3064 Solvers
-
Remove white space from the string
208 Solvers
-
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
905 Solvers
-
Matlab Basics - Assigning Variables
205 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
As i understand it, the algorithm is only supposed to change the middle element of the matrix. That means the answer to problem 1 in the test suite is incorrect.
@William, the problem is not only to change the middle term but to do basic operations with it.
In the first suite 5 is the middle number, add 2 and 8 (column elements) and then subtract 4 and 10 (row elements), so 5+2+8-4-10 = 1
Hi Muhammad,
Yes, I understand how the value x(2,2) was calculated, but why did the values of x(1,2) and x(3,2) change?
I do not understand why all the element in the second column equal 1 in the first test suit?