Problem 1725. Diagonal & Anti-Diagonal Matrix: Easy
Create a matrix as shown below from "magic" square.
For example:
if input x=9;then use mgic(x) and create the matrix below:
47 0 0 0 0 0 0 0 45
0 68 0 0 0 0 0 44 0
0 0 8 0 0 0 43 0 0
0 0 0 20 0 42 0 0 0
0 0 0 0 82 0 0 0 0
0 0 0 40 0 62 0 0 0
0 0 39 0 0 0 74 0 0
0 38 0 0 0 0 0 14 0
37 0 0 0 0 0 0 0 35if input x=3;then use mgic(x) and create the matrix below:
8 0 6
0 10 0
4 0 2
Solution Stats
Problem Comments
-
1 Comment
Marcel
on 9 Dec 2013
How about changing the problem such that the centre value is not doubled?
Solution Comments
Show commentsProblem Recent Solvers96
Suggested Problems
-
Project Euler: Problem 1, Multiples of 3 and 5
3660 Solvers
-
10608 Solvers
-
Find out missing number from a vector of 9 elements
320 Solvers
-
find the maximum element of the matrix
535 Solvers
-
What is Sum Of all elements of Matrix
444 Solvers
More from this Author16
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!