This is James's daughter again, sneaking into his Cody account. Thanks to your help in my math class last year, I did great! But now they're giving me even harder problems. This time, they're giving me a 2x2 matrix of numbers, and asking me to make it a 3x3 matrix so the center numbers on each side multiply to the numbers in the corner. It's kinda hard to explain, so I'll just give you the example our teacher gave us in class.
The matrix we were given is:
21 6
35 10
The correct answer is:
21 3 6
7 0 2
35 5 10
- The two numbers touching the 21 are 7 and 3, and 7x3=21.
- The two numbers touching the 35 are 7 and 5, and 7x5=35.
- The two numbers touching the 6 are 2 and 3, and 2x3=6.
- The two numbers touching the 10 are 2 and 5, and 2x5=10.
The zero in the middle doesn't really matter, so I don't care what number you put in there. Some of the problems might have more than one answer, but as long as the numbers multiply out correctly, it's a good answer. All of the numbers have to be integers, though. Thanks again for your help!
Solution Stats
Problem Comments
6 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers147
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15777 Solvers
-
Matrix indexing with two vectors of indices
774 Solvers
-
Find the index of n in magic(n)
269 Solvers
-
337 Solvers
-
423 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
I think the test suite is broken, I appear to only get x = [21,6;35,10] as the input and y is being displayed as a vector instead of the matrix that is returned. So either the return is being compared to an x that was not sent or y being a vector is causing the test cases to always fail.
Andrew, I just tried resubmitting my original solution, and the test suite was OK. What is the exact problem that you're having with the test suite when you submit your solution?
nice one!!
I've got the same problem as Andrew: The test suite always passes x = [21,6;35,10] to my function, even though x is assigned different values in the tests.
Hi Stefan, regarding your comment about the test suite always passing a fixed matrix, I looked into the solution space and the reference solution - the problem seems to be solvable. Where you referring to the Scratchpad by any chance? Let me know if you're still facing the issue, or if you've resolved it since the time you left the comment. Happy to help
There might have been formatting error with the first test case which led to the problems Andrew and Stefan faced.
I have corrected the error and the problem should work fine now.