Cody

# Problem 1088. Rank of magic square (for beginners)

Solution 172457

Submitted on 4 Dec 2012
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
%% n = 20; r = 3; filetext = fileread('mag_rang.m'); assert(isequal(mag_rang(n),r)) assert(isempty(strfind(filetext, 'rank'))) assert(isempty(strfind(filetext, 'magic')))

Error: Output argument "r" (and maybe others) not assigned during call to "/users/msssystem10/mag_rang.m>mag_rang".

2   Fail
%% n = 4; r = 3; filetext = fileread('mag_rang.m'); assert(isequal(mag_rang(n),r)) assert(isempty(strfind(filetext, 'rank'))) assert(isempty(strfind(filetext, 'magic')))

Error: Output argument "r" (and maybe others) not assigned during call to "/users/msssystem10/mag_rang.m>mag_rang".

3   Fail
%% n = 15; r = 15; filetext = fileread('mag_rang.m'); assert(isequal(mag_rang(n),r)) assert(isempty(strfind(filetext, 'rank'))) assert(isempty(strfind(filetext, 'magic')))

Error: Output argument "r" (and maybe others) not assigned during call to "/users/msssystem10/mag_rang.m>mag_rang".

4   Fail
%% n = 18; r = 11; filetext = fileread('mag_rang.m'); assert(isequal(mag_rang(n),r)) assert(isempty(strfind(filetext, 'rank'))) assert(isempty(strfind(filetext, 'magic')))

Error: Output argument "r" (and maybe others) not assigned during call to "/users/msssystem10/mag_rang.m>mag_rang".

5   Fail
%% n = 16; r = 3; filetext = fileread('mag_rang.m'); assert(isequal(mag_rang(n),r)) assert(isempty(strfind(filetext, 'rank'))) assert(isempty(strfind(filetext, 'magic')))

Error: Output argument "r" (and maybe others) not assigned during call to "/users/msssystem10/mag_rang.m>mag_rang".

6   Fail
%% n = 170; r = 87; filetext = fileread('mag_rang.m'); assert(isequal(mag_rang(n),r)) assert(isempty(strfind(filetext, 'rank'))) assert(isempty(strfind(filetext, 'magic')))

Error: Output argument "r" (and maybe others) not assigned during call to "/users/msssystem10/mag_rang.m>mag_rang".

7   Fail
%% n = 112; r = 3; filetext = fileread('mag_rang.m'); assert(isequal(mag_rang(n),r)) assert(isempty(strfind(filetext, 'rank'))) assert(isempty(strfind(filetext, 'magic')))

Error: Output argument "r" (and maybe others) not assigned during call to "/users/msssystem10/mag_rang.m>mag_rang".

8   Fail
%% n = 170; r = 87; filetext = fileread('mag_rang.m'); assert(isequal(mag_rang(n),r)) assert(isempty(strfind(filetext, 'rank'))) assert(isempty(strfind(filetext, 'magic')))

Error: Output argument "r" (and maybe others) not assigned during call to "/users/msssystem10/mag_rang.m>mag_rang".