Cody

# Problem 151. Magic!

Solution 1260580

Submitted on 1 Sep 2017 by Gulen Insay
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   Pass
x = magic(3); y_correct = true; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 3 r = 3 tf = logical 1

2   Pass
x = magic(7); y_correct = true; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 7 r = 7 tf = logical 1

3   Pass
x = eye(7); y_correct = false; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 7 r = 7

4   Pass
x = magic(2); y_correct = false; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 2 r = 2

5   Pass
x = magic(3)+1; y_correct = false; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 3 r = 3

6   Pass
x = flipud(magic(9)); y_correct = true; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 9 r = 9 tf = logical 1

7   Pass
x = fliplr(magic(11)); y_correct = true; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 11 r = 11 tf = logical 1

8   Pass
x = magic(4); y_correct = true; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 4 r = 4 tf = logical 1

9   Pass
x = flipud(magic(8)); y_correct = true; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 8 r = 8 tf = logical 1

10   Pass
x = [1 2; 3 4]; y_correct = false; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 2 r = 2

11   Pass
x = [1 2 3; 4 5 6]; y_correct = false; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 2 r = 3

12   Pass
x = ones(2); y_correct = false; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 2 r = 2

13   Pass
x = [7 1 6; 3 5 7; 4 9 3]; y_correct = false; assert(isequal(magical(x),y_correct))

tf = logical 0 c = 3 r = 3 tf = logical 0
{"ft_lang_label":"__label__en","ft_lang_prob":0.53862435,"math_prob":1.0000062,"size":1842,"snap":"2019-43-2019-47","text_gpt3_token_len":709,"char_repetition_ratio":0.25734493,"word_repetition_ratio":0.36887607,"special_character_ratio":0.41585234,"punctuation_ratio":0.124010555,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9999199,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-11-14T05:54:33Z\",\"WARC-Record-ID\":\"<urn:uuid:d8c8fdd8-f1b3-4ae4-bb0c-1c5b98d6f50e>\",\"Content-Length\":\"79466\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5993b598-45e5-4389-952e-127d102216d4>\",\"WARC-Concurrent-To\":\"<urn:uuid:25cc033a-e020-4efd-b9d6-f476743f3943>\",\"WARC-IP-Address\":\"104.110.193.39\",\"WARC-Target-URI\":\"https://kr.mathworks.com/matlabcentral/cody/problems/151-magic/solutions/1260580\",\"WARC-Payload-Digest\":\"sha1:ASSOTOAGSIAITHJWERQV32KFWYPEQTRH\",\"WARC-Block-Digest\":\"sha1:OAK4N37P27GXUQB3UW5APXIOD4CYECCF\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-47/CC-MAIN-2019-47_segments_1573496668004.65_warc_CC-MAIN-20191114053752-20191114081752-00094.warc.gz\"}"}