Like magic(4) = 16 3 2 13;5 10 11 8;9 6 7 12;4 15 14 1
Please correct the test suite so there are brackets around your y_correct. Adding a couple of other magic squares (5 and 6) would also help.
Hi Anumpam: Thanks for the problem. You need to fix the test suite as James says. Also, since you haven't specified what order you want the numbers in, you should probably check to make sure the matrix has magic properties (rows add to the same number, etc.) rather than testing that it matches exactly one matrix. There are lots of magic 4-by-4 matrices.
Hi Anupam, could you please correct this testsuite? (just change the line that reads "y_correct = 16 3 2 13;5 10 11 8;9 6 7 12;4 15 14 1" to read instead "y_correct = [16 3 2 13;5 10 11 8;9 6 7 12;4 15 14 1]")
I have changed as Mr. Alfonso says... but still problem exists...
The testsuite does not appear to be changed at all. Click on 'Edit' to edit this problem, then go to textbox titled 'Test Suite', add the brackets there to the "y_correct = ..." line, then click on the 'Save' button. Ideally you would also try out your own solution to this problem (in the textbox titled 'Reference Solution') and click on the 'Test reference solution' button to make sure that everything is working as expected...
yeah... now the prob is solved... thanks to all ... specially to mr. alfonso
Find common elements in matrix rows
Set the array elements whose value is 13 to 0
06 - Matrix Equations 1
MATLAB Basic: rounding
Square the input
Determine the Anti-diagonal of a Magic Square
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office