Question: Create a script that runs a loop over the values from N = 1 to N = 10 and outputs the magic sum. For N=2,
Create a script that runs a loop over the values from N = 1 to N = 10 and outputs the magic sum. For N=2, the script should output a statement that MATLAB does not output a valid magic square for N=2. In other words, your output should look like this: The magic sum for N=1 is 1 MATLAB does not output a valid 2x2 magic square The magic sum for N=3 is 15 The magic sum for N=4 is 34 The magic sum for N=5 is 65 The magic sum for N=6 is 111 The magic sum for N=7 is 175 The magic sum for N=8 is 260 The magic sum for N=9 is 369 The magic sum for N=10 is 505 Submit your script as an .m file in addition to this pdf. Additionally, paste your code here - include a comment for each and every line
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
