Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Matlab had been composing magic squares, a sequence of n numbers arranged in a square such As carly as 650 BC, mathematicians that all
Using Matlab had been composing magic squares, a sequence of n numbers arranged in a square such As carly as 650 BC, mathematicians that all rows, columns, and diagonals sum to the same constant. Used in China, India, and Arab countries for centuries, artist Albrecht Drer's engraving Melencolia 1(1514 C.E.) is considered the first time a magic square appears in European art. Each row, column, and diagonal of Drer's magic square sums to 34. In addition, each quadrant, the center four squares, and the comer squares all sum to 34. Drer's magic square is displayed below: 16 3 2 13 5 10 11 8 96 7 12 4 15 14 At various times they have acquired magical or mythical significance, and have appeared as symbols in works of art. In moderm times they have been generalized several ways, including using extra or different constraints, multiplying instcad of adding cells, using geometric operations lternate shapes or more than two dimensions, and replacing numbers with shapes and addition with You will develop a program to prove a series of numbers is indeed a 4 x 4 magic square. Pompt the user to enter their proposed magic square in a singie input statement (eg. [1234, 5678910 11 12, 13 14 15 -note that this example is a 4 x 4 matnx but is not a magic square). Determine if the matrix e te d not, inform the user of their mistake and prompt the user to re-enter another matrix. Repeat this check unil fhe it s successfully enters a correctly sized matrix. Check that each value in the matrix is a whole number. If it is not, prompt the ser to round the Humber up or down (sce example menu statements). Based on their choice, replace the decimal number with the rounded whole value
Using Matlab
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started