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
The magic square at the test suite is not the same as the output of the command magic. If there is a specific method for generating magic squares that the problem requires, it should be stated. Or the author could just verify if the returned matrix is indeed a magic square.
Renaming a field in a structure array
737 Solvers
Back to basics 8 - Matrix Diagonals
785 Solvers
589 Solvers
625 Solvers
Sum of odd numbers in a matrix
318 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!