{"group":{"group":{"id":41,"name":"Matrix Patterns III","lockable":false,"created_at":"2018-04-10T13:13:45.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"It's a technical type of art.","is_default":false,"created_by":26769,"badge_id":56,"featured":false,"trending":false,"solution_count_in_trending_period":11,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":418,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIt's a technical type of art.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}","description_html":"\u003cdiv style = \"text-align: start; line-height: normal; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; perspective-origin: 289.5px 10.5px; transform-origin: 289.5px 10.5px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; perspective-origin: 266.5px 10.5px; transform-origin: 266.5px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIt's a technical type of art.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","published_at":"2019-05-08T20:14:50.000Z"},"current_player":null},"problems":[{"id":1078,"title":"Make a diamond","description":"Given n, odd number \u003e 1, return n by n matrix consist of \"null\" and \"*\" characters arranged like a diamond. \r\n\r\nNo toolbox functions please.\r\n\r\nn = 3\r\n\r\nm = \r\n\r\n *\r\n* *\r\n *\r\n\r\nn = 7\r\n\r\nm =\r\n\r\n   *   \r\n  * *  \r\n *   *  \r\n*     *\r\n *   *  \r\n  * *\r\n   *\r\n\r\n\r\n","description_html":"\u003cp\u003eGiven n, odd number \u003e 1, return n by n matrix consist of \"null\" and \"*\" characters arranged like a diamond.\u003c/p\u003e\u003cp\u003eNo toolbox functions please.\u003c/p\u003e\u003cp\u003en = 3\u003c/p\u003e\u003cp\u003em =\u003c/p\u003e\u003cpre\u003e *\r\n* *\r\n *\u003c/pre\u003e\u003cp\u003en = 7\u003c/p\u003e\u003cp\u003em =\u003c/p\u003e\u003cpre\u003e   *   \r\n  * *  \r\n *   *  \r\n*     *\r\n *   *  \r\n  * *\r\n   *\u003c/pre\u003e","function_template":"function m = make_diamond(n)\r\n  m = n;\r\nend","test_suite":"%%\r\nn = 3;\r\nm = make_diamond(n);\r\nassert(strcmp(char(0), m(2,2)))\r\nassert(all(find(double(make_diamond(3)) == 0) == [1 3 5 7 9]') == 1)\r\n\r\n%%\r\nn = 9;\r\nm = make_diamond(n);\r\nassert(strcmp(char(0), m(5,5)))\r\n\r\n%%\r\nn = 35;\r\nm = make_diamond(n);\r\nassert(strcmp(char(0), m(15,15)))","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":4267,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":114,"test_suite_updated_at":"2012-12-01T17:17:49.000Z","rescore_all_solutions":false,"group_id":41,"created_at":"2012-11-29T21:46:44.000Z","updated_at":"2026-04-03T02:35:06.000Z","published_at":"2012-12-01T15:32:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven n, odd number \u0026gt; 1, return n by n matrix consist of \\\"null\\\" and \\\"*\\\" characters arranged like a diamond.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNo toolbox functions please.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003em =\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ *\\n* *\\n *]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 7\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003em =\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   *   \\n  * *  \\n *   *  \\n*     *\\n *   *  \\n  * *\\n   *]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1719,"title":"Dice face matrix!","description":"This is dice simulator, but instead of making a random die number, you will receive an \"pre-rolled\" number in and spit out a matrix of 1 and 0 that looks like a dice face of the given number. So for example:\r\n\r\n  rollnum = 1;\r\n\r\nThen the output will be:\r\n\r\n  diceFace =\r\n  \r\n       0     0     0\r\n       0     1     0\r\n       0     0     0\r\n\r\nAnother example:\r\n\r\n  rollnum = 5;\r\n\r\nThen the output will be:\r\n\r\n  diceFace =\r\n  \r\n       1     0     1\r\n       0     1     0\r\n       1     0     1\r\nAnd so on for 1-6, well that is it!\r\nJust note the 1 and 0 are numbers not char's or strings...\r\nGood luck!","description_html":"\u003cp\u003eThis is dice simulator, but instead of making a random die number, you will receive an \"pre-rolled\" number in and spit out a matrix of 1 and 0 that looks like a dice face of the given number. So for example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003erollnum = 1;\r\n\u003c/pre\u003e\u003cp\u003eThen the output will be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ediceFace =\r\n\u003c/pre\u003e\u003cpre\u003e       0     0     0\r\n       0     1     0\r\n       0     0     0\u003c/pre\u003e\u003cp\u003eAnother example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003erollnum = 5;\r\n\u003c/pre\u003e\u003cp\u003eThen the output will be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ediceFace =\r\n\u003c/pre\u003e\u003cpre\u003e       1     0     1\r\n       0     1     0\r\n       1     0     1\r\nAnd so on for 1-6, well that is it!\r\nJust note the 1 and 0 are numbers not char's or strings...\r\nGood luck!\u003c/pre\u003e","function_template":"function diceFace = rollADie(rollnum)\r\n  diceFace = rollnum;\r\nend","test_suite":"%%\r\nrollnum = 1;\r\ndiceFace = [0 0 0; 0 1 0; 0 0 0];\r\nassert(isequal(rollADie(rollnum),diceFace))\r\n%%\r\nrollnum = 2;\r\ndiceFace = [0 0 1; 0 0 0; 1 0 0];\r\nassert(isequal(rollADie(rollnum),diceFace))\r\n%%\r\nrollnum = 3;\r\ndiceFace = [0 0 1; 0 1 0; 1 0 0];\r\nassert(isequal(rollADie(rollnum),diceFace))\r\n%%\r\nrollnum = 4;\r\ndiceFace = [1 0 1; 0 0 0; 1 0 1];\r\nassert(isequal(rollADie(rollnum),diceFace))\r\n%%\r\nrollnum = 5;\r\ndiceFace = [1 0 1; 0 1 0; 1 0 1];\r\nassert(isequal(rollADie(rollnum),diceFace))\r\n%%\r\nrollnum = 6;\r\ndiceFace = [1 0 1; 1 0 1; 1 0 1];\r\nassert(isequal(rollADie(rollnum),diceFace))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":15013,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":136,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":41,"created_at":"2013-07-16T15:48:23.000Z","updated_at":"2026-04-03T02:36:03.000Z","published_at":"2013-07-16T15:48:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is dice simulator, but instead of making a random die number, you will receive an \\\"pre-rolled\\\" number in and spit out a matrix of 1 and 0 that looks like a dice face of the given number. So for example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[rollnum = 1;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThen the output will be:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[diceFace =\\n\\n       0     0     0\\n       0     1     0\\n       0     0     0]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAnother example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[rollnum = 5;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThen the output will be:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[diceFace =\\n\\n       1     0     1\\n       0     1     0\\n       1     0     1\\nAnd so on for 1-6, well that is it!\\nJust note the 1 and 0 are numbers not char's or strings...\\nGood luck!]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42591,"title":"Produce the following matrix","description":"Produce the following matrix\r\n\r\n x = [2 3 4]\r\n\r\n \r\n y_correct = \r\n [1   1/2   1/3;\r\n  2    1    1/4;\r\n  3    4     1];\r\n\r\n","description_html":"\u003cp\u003eProduce the following matrix\u003c/p\u003e\u003cpre\u003e x = [2 3 4]\u003c/pre\u003e\u003cpre\u003e y_correct = \r\n [1   1/2   1/3;\r\n  2    1    1/4;\r\n  3    4     1];\u003c/pre\u003e","function_template":"function y = matrixManipulation(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('matrixManipulation.m');\r\nassert(isempty(strfind(filetext, 'system')))\r\n\r\n\r\n\r\n%%\r\nx = 1;\r\ny_correct = ones(2);\r\nassert(isequal(matrixManipulation(x),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny_correct = [1 1/2; 2 1];\r\nassert(isequal(matrixManipulation(x),y_correct))\r\n\r\n%%\r\nx = 2:4;\r\ny_correct = [1 1/2 1/3; 2 1 1/4; 3 4 1];\r\nassert(isequal(matrixManipulation(x),y_correct))\r\n\r\n%%\r\nx = 2:7;\r\ny_correct = [1 1/2 1/3 1/4; 2 1 1/5 1/6; 3 5 1 1/7; 4 6 7 1];\r\nassert(isequal(matrixManipulation(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":85,"test_suite_updated_at":"2015-09-10T17:27:08.000Z","rescore_all_solutions":false,"group_id":41,"created_at":"2015-09-09T18:52:43.000Z","updated_at":"2026-04-03T02:36:46.000Z","published_at":"2015-09-09T18:52:43.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eProduce the following matrix\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x = [2 3 4]\\n\\n y_correct = \\n [1   1/2   1/3;\\n  2    1    1/4;\\n  3    4     1];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43073,"title":"Check if a matrix is a palindrome in all directions","description":"Check if a matrix is a palindrome both vertically and horizontally.\r\n\r\nYou function will return *true* for |[1,2,1]| or |[2,7,2; 6,9,6; 2,7,2]| . But it should return *false* for |[1,2,3]| or |[2,7,2; 6,9,6; 3,5,3]| .","description_html":"\u003cp\u003eCheck if a matrix is a palindrome both vertically and horizontally.\u003c/p\u003e\u003cp\u003eYou function will return \u003cb\u003etrue\u003c/b\u003e for \u003ctt\u003e[1,2,1]\u003c/tt\u003e or \u003ctt\u003e[2,7,2; 6,9,6; 2,7,2]\u003c/tt\u003e . But it should return \u003cb\u003efalse\u003c/b\u003e for \u003ctt\u003e[1,2,3]\u003c/tt\u003e or \u003ctt\u003e[2,7,2; 6,9,6; 3,5,3]\u003c/tt\u003e .\u003c/p\u003e","function_template":"function y = isPalindrome(x)\r\n    y = true;\r\nend","test_suite":"%%\r\nx = [4,5,5,4];\r\ny_correct = true;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx =ones(4);\r\ny_correct = true;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx = [2,7,2; 6,9,6; 2,7,2];\r\ny_correct = true;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx = [1,2,3];\r\ny_correct = false;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx = [2,7,2; 6,9,6; 3,5,3];\r\ny_correct = false;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":25354,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":135,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":41,"created_at":"2016-10-05T20:25:20.000Z","updated_at":"2026-03-12T16:10:38.000Z","published_at":"2016-10-05T20:25:20.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCheck if a matrix is a palindrome both vertically and horizontally.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou function will return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003etrue\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[1,2,1]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[2,7,2; 6,9,6; 2,7,2]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . But it should return\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efalse\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[1,2,3]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e[2,7,2; 6,9,6; 3,5,3]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e .\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43284,"title":"Form a square matrix from four square sub-matrices","description":"Create a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4):\r\n\r\n y = [x1 x2;\r\n      x3 x4];\r\n\r\nThe size of each sub-matrix will be n, while given values should be applied to each sub-matrix.\r\n\r\n* 1st sub-matrix: n1 on the main diagonal with all other elements equal to 0\r\n* 2nd sub-matrix: all elements equal to n2\r\n* 3rd sub-matrix: all elements equal to n3\r\n* 4th sub-matrix: same as the first but with diagonal elements equal to n4.\r\n\r\nFor example, with n=2, n1=1, n2=2, n3=3, and n4=5:\r\n\r\n y = [1 0 2 2;\r\n      0 1 2 2;\r\n      3 3 5 0;\r\n      3 3 0 5];","description_html":"\u003cp\u003eCreate a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4):\u003c/p\u003e\u003cpre\u003e y = [x1 x2;\r\n      x3 x4];\u003c/pre\u003e\u003cp\u003eThe size of each sub-matrix will be n, while given values should be applied to each sub-matrix.\u003c/p\u003e\u003cul\u003e\u003cli\u003e1st sub-matrix: n1 on the main diagonal with all other elements equal to 0\u003c/li\u003e\u003cli\u003e2nd sub-matrix: all elements equal to n2\u003c/li\u003e\u003cli\u003e3rd sub-matrix: all elements equal to n3\u003c/li\u003e\u003cli\u003e4th sub-matrix: same as the first but with diagonal elements equal to n4.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eFor example, with n=2, n1=1, n2=2, n3=3, and n4=5:\u003c/p\u003e\u003cpre\u003e y = [1 0 2 2;\r\n      0 1 2 2;\r\n      3 3 5 0;\r\n      3 3 0 5];\u003c/pre\u003e","function_template":"function y = CreateMatrix(n,n1,n2,n3,n4)\r\n  y = n;\r\nend","test_suite":"%%\r\nn=2;\r\nn1=1;\r\nn2=2;\r\nn3=3;\r\nn4=5;\r\ny = [1 0 2 2;\r\n     0 1 2 2;\r\n     3 3 5 0;\r\n     3 3 0 5];\r\nassert(isequal(CreateMatrix(n,n1,n2,n3,n4),y))\r\n\r\n%%\r\nn=2;\r\nn1=5;\r\nn2=2;\r\nn3=3;\r\nn4=-4;\r\ny = [5 0  2  2;\r\n     0 5  2  2;\r\n     3 3 -4  0;\r\n     3 3  0 -4];\r\nassert(isequal(CreateMatrix(n,n1,n2,n3,n4),y))\r\n\r\n%%\r\nn=3;\r\nn1=3;\r\nn2=2;\r\nn3=7;\r\nn4=1;\r\ny = [3 0 0 2 2 2;\r\n     0 3 0 2 2 2;\r\n     0 0 3 2 2 2;\r\n     7 7 7 1 0 0;\r\n     7 7 7 0 1 0;\r\n     7 7 7 0 0 1];\r\nassert(isequal(CreateMatrix(n,n1,n2,n3,n4),y))\r\n\r\n%%\r\nn=2;\r\nn1=4;\r\nn2=8;\r\nn3=8;\r\nn4=2;\r\ny = [4 0 8 8;\r\n     0 4 8 8;\r\n     8 8 2 0;\r\n     8 8 0 2];\r\nassert(isequal(CreateMatrix(n,n1,n2,n3,n4),y))\r\n\r\n%%\r\nn=5;\r\nn1=4;\r\nn2=3;\r\nn3=2;\r\nn4=1;\r\ny = [4 0 0 0 0 3 3 3 3 3;\r\n     0 4 0 0 0 3 3 3 3 3;\r\n     0 0 4 0 0 3 3 3 3 3;\r\n     0 0 0 4 0 3 3 3 3 3;\r\n     0 0 0 0 4 3 3 3 3 3;\r\n     2 2 2 2 2 1 0 0 0 0;\r\n     2 2 2 2 2 0 1 0 0 0;\r\n     2 2 2 2 2 0 0 1 0 0;\r\n     2 2 2 2 2 0 0 0 1 0;\r\n     2 2 2 2 2 0 0 0 0 1];\r\nassert(isequal(CreateMatrix(n,n1,n2,n3,n4),y))\r\n\r\n%%\r\nn=6;\r\nn1=4;\r\nn2=7;\r\nn3=1;\r\nn4=9;\r\ny = [4 0 0 0 0 0 7 7 7 7 7 7;\r\n     0 4 0 0 0 0 7 7 7 7 7 7;\r\n     0 0 4 0 0 0 7 7 7 7 7 7;\r\n     0 0 0 4 0 0 7 7 7 7 7 7;\r\n     0 0 0 0 4 0 7 7 7 7 7 7;\r\n     0 0 0 0 0 4 7 7 7 7 7 7;\r\n     1 1 1 1 1 1 9 0 0 0 0 0;\r\n     1 1 1 1 1 1 0 9 0 0 0 0;\r\n     1 1 1 1 1 1 0 0 9 0 0 0;\r\n     1 1 1 1 1 1 0 0 0 9 0 0;\r\n     1 1 1 1 1 1 0 0 0 0 9 0;\r\n     1 1 1 1 1 1 0 0 0 0 0 9];\r\nassert(isequal(CreateMatrix(n,n1,n2,n3,n4),y))","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":134,"test_suite_updated_at":"2016-11-28T17:27:57.000Z","rescore_all_solutions":false,"group_id":41,"created_at":"2016-10-09T15:39:12.000Z","updated_at":"2026-04-03T10:55:21.000Z","published_at":"2016-10-09T15:39:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4):\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ y = [x1 x2;\\n      x3 x4];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe size of each sub-matrix will be n, while given values should be applied to each sub-matrix.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1st sub-matrix: n1 on the main diagonal with all other elements equal to 0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e2nd sub-matrix: all elements equal to n2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e3rd sub-matrix: all elements equal to n3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e4th sub-matrix: same as the first but with diagonal elements equal to n4.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, with n=2, n1=1, n2=2, n3=3, and n4=5:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ y = [1 0 2 2;\\n      0 1 2 2;\\n      3 3 5 0;\\n      3 3 0 5];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43492,"title":"Create a square matrix with given conditions","description":"Create a square matrix, M, which should be populated as follows:\r\n\r\n M = [ n^2      n * (n-1)    n * (n-2)  ...    n * 2    n * 1;\r\n     (n-1)*n  (n-1)*(n-1)  (n-1)*(n-2)  ...  (n-1)*2  (n-1)*1;\r\n     (n-2)*n  (n-2)*(n-1)  (n-2)*(n-2)  ...  (n-2)*2  (n-2)*1;\r\n        .          .            .       .       .       .    ;\r\n        .          .            .        .      .       .    ;\r\n        .          .            .         .     .       .    ;\r\n       2 * n    2 * (n-1)    2 * (n-2)  ...    2 * 2    2 * 1;\r\n       1 * n    1 * (n-1)    1 * (n-2)  ...    1 * 2    1 * 1]","description_html":"\u003cp\u003eCreate a square matrix, M, which should be populated as follows:\u003c/p\u003e\u003cpre\u003e M = [ n^2      n * (n-1)    n * (n-2)  ...    n * 2    n * 1;\r\n     (n-1)*n  (n-1)*(n-1)  (n-1)*(n-2)  ...  (n-1)*2  (n-1)*1;\r\n     (n-2)*n  (n-2)*(n-1)  (n-2)*(n-2)  ...  (n-2)*2  (n-2)*1;\r\n        .          .            .       .       .       .    ;\r\n        .          .            .        .      .       .    ;\r\n        .          .            .         .     .       .    ;\r\n       2 * n    2 * (n-1)    2 * (n-2)  ...    2 * 2    2 * 1;\r\n       1 * n    1 * (n-1)    1 * (n-2)  ...    1 * 2    1 * 1]\u003c/pre\u003e","function_template":"function y = ResultMatrix(n)\r\n  y = 1:n;\r\nend","test_suite":"%%\r\nn = 1;\r\ny = 1;\r\nassert(isequal(ResultMatrix(n),y))\r\n\r\n%%\r\nn = 3;\r\ny =[9 6 3;\r\n    6 4 2;\r\n    3 2 1];\r\nassert(isequal(ResultMatrix(n),y))\r\n\r\n%%\r\nn = 4;\r\ny =[16 12 8 4;\r\n    12  9 6 3;\r\n     8  6 4 2;\r\n     4  3 2 1];\r\nassert(isequal(ResultMatrix(n),y))\r\n\r\n%%\r\nn = 5;\r\ny =[25 20 15 10 5;\r\n    20 16 12  8 4;\r\n    15 12  9  6 3;\r\n    10  8  6  4 2;\r\n     5  4  3  2 1];\r\nassert(isequal(ResultMatrix(n),y))\r\n\r\n%%\r\nn = 7;\r\ny=[49 42 35 28 21 14  7\r\n   42 36 30 24 18 12  6\r\n   35 30 25 20 15 10  5\r\n   28 24 20 16 12  8  4\r\n   21 18 15 12  9  6  3\r\n   14 12 10  8  6  4  2\r\n    7  6  5  4  3  2  1];\r\nassert(isequal(ResultMatrix(n),y))\r\n\r\n%%\r\nn = 10;\r\ny=[100 90 80 70 60 50 40 30 20 10;\r\n    90 81 72 63 54 45 36 27 18  9;\r\n    80 72 64 56 48 40 32 24 16  8;\r\n    70 63 56 49 42 35 28 21 14  7;\r\n    60 54 48 42 36 30 24 18 12  6;\r\n    50 45 40 35 30 25 20 15 10  5;\r\n    40 36 32 28 24 20 16 12  8  4;\r\n    30 27 24 21 18 15 12  9  6  3;\r\n    20 18 16 14 12 10  8  6  4  2;\r\n    10  9  8  7  6  5  4  3  2  1];\r\nassert(isequal(ResultMatrix(n),y))","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":140,"test_suite_updated_at":"2016-11-29T18:58:05.000Z","rescore_all_solutions":false,"group_id":41,"created_at":"2016-10-12T17:58:19.000Z","updated_at":"2026-02-14T08:47:48.000Z","published_at":"2016-10-12T17:58:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate a square matrix, M, which should be populated as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ M = [ n^2      n * (n-1)    n * (n-2)  ...    n * 2    n * 1;\\n     (n-1)*n  (n-1)*(n-1)  (n-1)*(n-2)  ...  (n-1)*2  (n-1)*1;\\n     (n-2)*n  (n-2)*(n-1)  (n-2)*(n-2)  ...  (n-2)*2  (n-2)*1;\\n        .          .            .       .       .       .    ;\\n        .          .            .        .      .       .    ;\\n        .          .            .         .     .       .    ;\\n       2 * n    2 * (n-1)    2 * (n-2)  ...    2 * 2    2 * 1;\\n       1 * n    1 * (n-1)    1 * (n-2)  ...    1 * 2    1 * 1]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43651,"title":"create a square matrix","description":"create a [n*n] matrix. \r\nexample:\r\n\r\n   mat(4)= [ 1     4     9    16\r\n            4     4     9    16\r\n            9     9     9    16\r\n           16    16    16    16]\r\n    ","description_html":"\u003cp\u003ecreate a [n*n] matrix. \r\nexample:\u003c/p\u003e\u003cpre\u003e   mat(4)= [ 1     4     9    16\r\n            4     4     9    16\r\n            9     9     9    16\r\n           16    16    16    16]\u003c/pre\u003e","function_template":"function y = mat(n)\r\n  y = n;\r\nend","test_suite":"%%\r\nn = 3;\r\ny_correct =[1     4     9\r\n     4     4     9\r\n     9     9     9]\r\nassert(isequal(mat(n),y_correct))\r\n%%\r\nn = 4;\r\ny_correct = [1     4     9    16\r\n            4     4     9    16\r\n            9     9     9    16\r\n            16    16    16    16]\r\nassert(isequal(mat(n),y_correct))\r\n%%\r\nn= 7;\r\ny_correct =[1     4     9    16    25    36    49\r\n     4     4     9    16    25    36    49\r\n     9     9     9    16    25    36    49\r\n    16    16    16    16    25    36    49\r\n    25    25    25    25    25    36    49\r\n    36    36    36    36    36    36    49\r\n    49    49    49    49    49    49    49]\r\nassert(isequal(mat(n),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":88430,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":189,"test_suite_updated_at":"2016-12-14T19:49:21.000Z","rescore_all_solutions":false,"group_id":41,"created_at":"2016-11-11T13:44:23.000Z","updated_at":"2026-04-03T10:38:08.000Z","published_at":"2016-11-11T13:44:23.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecreate a [n*n] matrix. example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   mat(4)= [ 1     4     9    16\\n            4     4     9    16\\n            9     9     9    16\\n           16    16    16    16]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43656,"title":"Tent matrix","description":"Create an n x n matrix that resembles one kind of tent. The variable n is provided to the function and will be an odd number. As an example, if n=5:\r\n\r\n surround(5) = 1  2  3  2  1\r\n               2  3  4  3  2\r\n               3  4  5  4  3\r\n               2  3  4  3  2\r\n               1  2  3  2  1","description_html":"\u003cp\u003eCreate an n x n matrix that resembles one kind of tent. The variable n is provided to the function and will be an odd number. As an example, if n=5:\u003c/p\u003e\u003cpre\u003e surround(5) = 1  2  3  2  1\r\n               2  3  4  3  2\r\n               3  4  5  4  3\r\n               2  3  4  3  2\r\n               1  2  3  2  1\u003c/pre\u003e","function_template":"function y = surround(n)\r\n  y=n\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(surround(n),y_correct))\r\n%%\r\nn=3\r\ny_correct =  [1     2     1\r\n             2     3     2\r\n             1     2     1];\r\nassert(isequal(surround(n),y_correct))\r\n%%\r\nn=5\r\ny_correct =   [1  2  3  2  1\r\n               2  3  4  3  2\r\n               3  4  5  4  3\r\n               2  3  4  3  2\r\n               1  2  3  2  1];\r\nassert(isequal(surround(n),y_correct))\r\n%%\r\nn=7\r\ny_correct =   [1     2     3     4     3     2     1\r\n               2     3     4     5     4     3     2\r\n               3     4     5     6     5     4     3\r\n               4     5     6     7     6     5     4\r\n               3     4     5     6     5     4     3\r\n               2     3     4     5     4     3     2\r\n               1     2     3     4     3     2     1];\r\nassert(isequal(surround(n),y_correct))\r\n%%\r\nn=11\r\ny_correct =   [  1     2     3     4     5     6     5     4     3     2     1\r\n                 2     3     4     5     6     7     6     5     4     3     2\r\n                 3     4     5     6     7     8     7     6     5     4     3\r\n                 4     5     6     7     8     9     8     7     6     5     4\r\n                 5     6     7     8     9    10     9     8     7     6     5\r\n                 6     7     8     9    10    11    10     9     8     7     6\r\n                 5     6     7     8     9    10     9     8     7     6     5\r\n                 4     5     6     7     8     9     8     7     6     5     4\r\n                 3     4     5     6     7     8     7     6     5     4     3\r\n                 2     3     4     5     6     7     6     5     4     3     2\r\n                 1     2     3     4     5     6     5     4     3     2     1];\r\nassert(isequal(surround(n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":88430,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":97,"test_suite_updated_at":"2016-12-15T19:44:12.000Z","rescore_all_solutions":false,"group_id":41,"created_at":"2016-11-15T15:49:18.000Z","updated_at":"2026-02-14T08:52:24.000Z","published_at":"2016-11-15T15:50:43.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate an n x n matrix that resembles one kind of tent. The variable n is provided to the function and will be an odd number. As an example, if n=5:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ surround(5) = 1  2  3  2  1\\n               2  3  4  3  2\\n               3  4  5  4  3\\n               2  3  4  3  2\\n               1  2  3  2  1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43752,"title":"Vandermonde Matrix","description":"Create the Vandermonde Matrix of the given vector. The matrix consists of columns as powers of the vector, so the first column is the inverse of the vector raised to 0. The second column is the vector raised to 1, etc.\r\n\r\nFor example, given the vector:\r\n\r\n  v=[1 2 3 4 5];\r\n\r\nthe Vandermonde Matrix would be\r\n\r\n  Vm=\r\n     1     1     1     1     1\r\n     1     2     4     8    16\r\n     1     3     9    27    81\r\n     1     4    16    64   256\r\n     1     5    25   125   625\r\n\r\nSee \u003chttps://en.wikipedia.org/wiki/Vandermonde_matrix Vandermonde Matrix\u003e for more details.","description_html":"\u003cp\u003eCreate the Vandermonde Matrix of the given vector. The matrix consists of columns as powers of the vector, so the first column is the inverse of the vector raised to 0. The second column is the vector raised to 1, etc.\u003c/p\u003e\u003cp\u003eFor example, given the vector:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ev=[1 2 3 4 5];\r\n\u003c/pre\u003e\u003cp\u003ethe Vandermonde Matrix would be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eVm=\r\n   1     1     1     1     1\r\n   1     2     4     8    16\r\n   1     3     9    27    81\r\n   1     4    16    64   256\r\n   1     5    25   125   625\r\n\u003c/pre\u003e\u003cp\u003eSee \u003ca href = \"https://en.wikipedia.org/wiki/Vandermonde_matrix\"\u003eVandermonde Matrix\u003c/a\u003e for more details.\u003c/p\u003e","function_template":"function y = vandimat(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1:5;\r\ny_correct = [1,1,1,1,1;1,2,4,8,16;1,3,9,27,81;1,4,16,64,256;1,5,25,125,625];\r\nassert(isequal(vandimat(x),y_correct))\r\n%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(vandimat(x),y_correct))\r\n%%\r\nx = ones(1,20);\r\ny_correct = ones(20);\r\nassert(isequal(vandimat(x),y_correct))\r\n%%\r\nx = 3.*ones(1,15);\r\ny_correct = repmat([1,3,9,27,81,243,729,2187,6561,19683,59049,177147,531441,1594323,4782969],15,1);\r\nassert(isequal(vandimat(x),y_correct))\r\n%%\r\nx = [1 5 2 4 3];\r\ny_correct = [1,1,1,1,1;1,5,25,125,625;1,2,4,8,16;1,4,16,64,256;1,3,9,27,81];\r\nassert(isequal(vandimat(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":93456,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":113,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":41,"created_at":"2016-12-07T21:54:07.000Z","updated_at":"2026-02-14T08:53:16.000Z","published_at":"2016-12-07T21:54:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate the Vandermonde Matrix of the given vector. The matrix consists of columns as powers of the vector, so the first column is the inverse of the vector raised to 0. The second column is the vector raised to 1, etc.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example, given the vector:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[v=[1 2 3 4 5];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethe Vandermonde Matrix would be\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Vm=\\n   1     1     1     1     1\\n   1     2     4     8    16\\n   1     3     9    27    81\\n   1     4    16    64   256\\n   1     5    25   125   625]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Vandermonde_matrix\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eVandermonde Matrix\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for more details.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43801,"title":"Union Jack Matrix","description":"Create a matrix of odd dimensions that has ones on both diagonals and dividing the matrix into 4 quadrants, resembling a square union jack flag. For example, if n=11:\r\n\r\n  1  0  0  0  0  1  0  0  0  0  1\r\n0  1  0  0  0  1  0  0  0  1  0\r\n0  0  1  0  0  1  0  0  1  0  0\r\n0  0  0  1  0  1  0  1  0  0  0\r\n0  0  0  0  1  1  1  0  0  0  0\r\n1  1  1  1  1  1  1  1  1  1  1\r\n0  0  0  0  1  1  1  0  0  0  0\r\n0  0  0  1  0  1  0  1  0  0  0\r\n0  0  1  0  0  1  0  0  1  0  0\r\n0  1  0  0  0  1  0  0  0  1  0\r\n1  0  0  0  0  1  0  0  0  0  1\r\n\r\n","description_html":"\u003cp\u003eCreate a matrix of odd dimensions that has ones on both diagonals and dividing the matrix into 4 quadrants, resembling a square union jack flag. For example, if n=11:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e1  0  0  0  0  1  0  0  0  0  1\r\n0  1  0  0  0  1  0  0  0  1  0\r\n0  0  1  0  0  1  0  0  1  0  0\r\n0  0  0  1  0  1  0  1  0  0  0\r\n0  0  0  0  1  1  1  0  0  0  0\r\n1  1  1  1  1  1  1  1  1  1  1\r\n0  0  0  0  1  1  1  0  0  0  0\r\n0  0  0  1  0  1  0  1  0  0  0\r\n0  0  1  0  0  1  0  0  1  0  0\r\n0  1  0  0  0  1  0  0  0  1  0\r\n1  0  0  0  0  1  0  0  0  0  1\r\n\u003c/pre\u003e","function_template":"function y = union_jack(n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(union_jack(x),y_correct))\r\n\r\n%%\r\nx = 3;\r\ny_correct = ones(3);\r\nassert(isequal(union_jack(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = [1,0,1,0,1;\r\n             0,1,1,1,0;\r\n             1,1,1,1,1;\r\n             0,1,1,1,0;\r\n             1,0,1,0,1];\r\nassert(isequal(union_jack(x),y_correct))\r\n\r\n%%\r\nx = 7;\r\ny_correct = [1,0,0,1,0,0,1;\r\n             0,1,0,1,0,1,0;\r\n             0,0,1,1,1,0,0;\r\n             1,1,1,1,1,1,1;\r\n             0,0,1,1,1,0,0;\r\n             0,1,0,1,0,1,0;\r\n             1,0,0,1,0,0,1];\r\nassert(isequal(union_jack(x),y_correct))\r\n\r\n%%\r\nx = 9;\r\ny_correct = [1,0,0,0,1,0,0,0,1;\r\n             0,1,0,0,1,0,0,1,0;\r\n             0,0,1,0,1,0,1,0,0;\r\n             0,0,0,1,1,1,0,0,0;\r\n             1,1,1,1,1,1,1,1,1;\r\n             0,0,0,1,1,1,0,0,0;\r\n             0,0,1,0,1,0,1,0,0;\r\n             0,1,0,0,1,0,0,1,0;\r\n             1,0,0,0,1,0,0,0,1];\r\nassert(isequal(union_jack(x),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":93456,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":109,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":41,"created_at":"2016-12-13T23:06:30.000Z","updated_at":"2026-02-14T08:54:09.000Z","published_at":"2016-12-13T23:06:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate a matrix of odd dimensions that has ones on both diagonals and dividing the matrix into 4 quadrants, resembling a square union jack flag. For example, if n=11:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[1  0  0  0  0  1  0  0  0  0  1\\n0  1  0  0  0  1  0  0  0  1  0\\n0  0  1  0  0  1  0  0  1  0  0\\n0  0  0  1  0  1  0  1  0  0  0\\n0  0  0  0  1  1  1  0  0  0  0\\n1  1  1  1  1  1  1  1  1  1  1\\n0  0  0  0  1  1  1  0  0  0  0\\n0  0  0  1  0  1  0  1  0  0  0\\n0  0  1  0  0  1  0  0  1  0  0\\n0  1  0  0  0  1  0  0  0  1  0\\n1  0  0  0  0  1  0  0  0  0  1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44063,"title":"Make a rainbow matrix (follow-up to checkerboard matrix)","description":"Given an integer n, make an n-by-n matrix as shown below. The a(1,1) should be 0. As we move away from the top-left, the number increase by 1, until we hit a diagonal, where all the elements are (n-1) along the diagonal. After passing diagonal, the number increases by 1 each time.\r\n\r\nThis is a follow-up question to Cody Challenge CheckerBoard Problem at \u003chttps://www.mathworks.com/matlabcentral/cody/problems/4-make-a-checkerboard-matrix\u003e\r\n\r\nFor n=10 \r\n\r\n Input  n = 10\r\n Output a is\r\n  [0   1   2   3   4   5   6   7   8   9\r\n   1   2   3   4   5   6   7   8   9   8\r\n   2   3   4   5   6   7   8   9   8   7\r\n   3   4   5   6   7   8   9   8   7   6\r\n   4   5   6   7   8   9   8   7   6   5\r\n   5   6   7   8   9   8   7   6   5   4\r\n   6   7   8   9   8   7   6   5   4   3\r\n   7   8   9   8   7   6   5   4   3   2\r\n   8   9   8   7   6   5   4   3   2   1\r\n   9   8   7   6   5   4   3   2   1   0]\r\n   ","description_html":"\u003cp\u003eGiven an integer n, make an n-by-n matrix as shown below. The a(1,1) should be 0. As we move away from the top-left, the number increase by 1, until we hit a diagonal, where all the elements are (n-1) along the diagonal. After passing diagonal, the number increases by 1 each time.\u003c/p\u003e\u003cp\u003eThis is a follow-up question to Cody Challenge CheckerBoard Problem at \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/4-make-a-checkerboard-matrix\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/4-make-a-checkerboard-matrix\u003c/a\u003e\u003c/p\u003e\u003cp\u003eFor n=10\u003c/p\u003e\u003cpre\u003e Input  n = 10\r\n Output a is\r\n  [0   1   2   3   4   5   6   7   8   9\r\n   1   2   3   4   5   6   7   8   9   8\r\n   2   3   4   5   6   7   8   9   8   7\r\n   3   4   5   6   7   8   9   8   7   6\r\n   4   5   6   7   8   9   8   7   6   5\r\n   5   6   7   8   9   8   7   6   5   4\r\n   6   7   8   9   8   7   6   5   4   3\r\n   7   8   9   8   7   6   5   4   3   2\r\n   8   9   8   7   6   5   4   3   2   1\r\n   9   8   7   6   5   4   3   2   1   0]\u003c/pre\u003e","function_template":"function a = rainBowMatrix(n)\r\n  a = magic(n);\r\nend","test_suite":"%%\r\nn = 2;\r\na_correct = [0 1;\r\n             1 0];\r\nassert(isequal(rainBowMatrix(n),a_correct))\r\n\r\n%%\r\nn = 3;\r\na_correct = [0 1 2;\r\n             1 2 1;\r\n             2 1 0];\r\nassert(isequal(rainBowMatrix(n),a_correct))\r\n\r\n%%\r\nn = 4;\r\na_correct = [0   1   2   3;\r\n             1   2   3   2;\r\n             2   3   2   1;\r\n             3   2   1   0];\r\nassert(isequal(rainBowMatrix(n),a_correct))\r\n\r\n%%\r\nn = 5;\r\na_correct = [0   1   2   3   4;\r\n             1   2   3   4   3;\r\n             2   3   4   3   2;\r\n             3   4   3   2   1;\r\n             4   3   2   1   0];\r\nassert(isequal(rainBowMatrix(n),a_correct))\r\n\r\n%%\r\nn = 6;\r\na_correct = [0   1   2   3   4   5;\r\n             1   2   3   4   5   4;\r\n             2   3   4   5   4   3;\r\n             3   4   5   4   3   2;\r\n             4   5   4   3   2   1;\r\n             5   4   3   2   1   0];\r\nassert(isequal(rainBowMatrix(n),a_correct))\r\n\r\n%%\r\nn = 8;\r\na_correct = [0   1   2   3   4   5   6   7;\r\n             1   2   3   4   5   6   7   6;\r\n             2   3   4   5   6   7   6   5;\r\n             3   4   5   6   7   6   5   4;\r\n             4   5   6   7   6   5   4   3;\r\n             5   6   7   6   5   4   3   2;\r\n             6   7   6   5   4   3   2   1;\r\n             7   6   5   4   3   2   1   0];\r\nassert(isequal(rainBowMatrix(n),a_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":115733,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":90,"test_suite_updated_at":"2018-07-31T17:49:51.000Z","rescore_all_solutions":false,"group_id":41,"created_at":"2017-02-09T18:42:50.000Z","updated_at":"2026-02-27T13:38:30.000Z","published_at":"2017-02-09T18:50:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven an integer n, make an n-by-n matrix as shown below. The a(1,1) should be 0. As we move away from the top-left, the number increase by 1, until we hit a diagonal, where all the elements are (n-1) along the diagonal. After passing diagonal, the number increases by 1 each time.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is a follow-up question to Cody Challenge CheckerBoard Problem at\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/4-make-a-checkerboard-matrix\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/4-make-a-checkerboard-matrix\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor n=10\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ Input  n = 10\\n Output a is\\n  [0   1   2   3   4   5   6   7   8   9\\n   1   2   3   4   5   6   7   8   9   8\\n   2   3   4   5   6   7   8   9   8   7\\n   3   4   5   6   7   8   9   8   7   6\\n   4   5   6   7   8   9   8   7   6   5\\n   5   6   7   8   9   8   7   6   5   4\\n   6   7   8   9   8   7   6   5   4   3\\n   7   8   9   8   7   6   5   4   3   2\\n   8   9   8   7   6   5   4   3   2   1\\n   9   8   7   6   5   4   3   2   1   0]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44469,"title":"Diagonal Pattern","description":"For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given according to the following rules:\r\n\r\n* |i - j|, if |i \u003e j|\r\n* |j - i|, if |i \u003c j|\r\n* |0|,   if |i| equals |j|\r\n\r\nIf |n| is not a positive integer, |mat| should be an empty matrix.\r\n\r\nExamples:\r\n\r\n  Input:  n   = 4\r\n  Output: mat = [0  1  2  3\r\n                 1  0  1  2\r\n                 2  1  0  1\r\n                 3  2  1  0]\r\n\r\n  Input:  n   = -2\r\n  Output: mat = []\r\n\r\n  Input:  n   = 2.5\r\n  Output: mat = []\r\n","description_html":"\u003cp\u003eFor a positive integer \u003ctt\u003en\u003c/tt\u003e, return an \u003ctt\u003enXn\u003c/tt\u003e matrix \u003ctt\u003emat\u003c/tt\u003e such that the value of each element in row \u003ctt\u003ei\u003c/tt\u003e and column \u003ctt\u003ej\u003c/tt\u003e is given according to the following rules:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ctt\u003ei - j\u003c/tt\u003e, if \u003ctt\u003ei \u0026gt; j\u003c/tt\u003e\u003c/li\u003e\u003cli\u003e\u003ctt\u003ej - i\u003c/tt\u003e, if \u003ctt\u003ei \u0026lt; j\u003c/tt\u003e\u003c/li\u003e\u003cli\u003e\u003ctt\u003e0\u003c/tt\u003e,   if \u003ctt\u003ei\u003c/tt\u003e equals \u003ctt\u003ej\u003c/tt\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eIf \u003ctt\u003en\u003c/tt\u003e is not a positive integer, \u003ctt\u003emat\u003c/tt\u003e should be an empty matrix.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:  n   = 4\r\nOutput: mat = [0  1  2  3\r\n               1  0  1  2\r\n               2  1  0  1\r\n               3  2  1  0]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eInput:  n   = -2\r\nOutput: mat = []\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eInput:  n   = 2.5\r\nOutput: mat = []\r\n\u003c/pre\u003e","function_template":"function mat = diagonalPattern(n)\r\n    mat = diag(n);\r\nend","test_suite":"%%\r\nfiletext = fileread('diagonalPattern.m');\r\nassert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')\r\n\r\n%%\r\nn = 1;\r\nmat_correct = 0;\r\nassert(isequal(diagonalPattern(n),mat_correct))\r\n\r\n%%\r\nn = -1;\r\nmat_correct = [];\r\nassert(isequal(diagonalPattern(n),mat_correct))\r\n\r\n%%\r\nn = 1.5;\r\nmat_correct = [];\r\nassert(isequal(diagonalPattern(n),mat_correct))\r\n\r\n%%\r\nn = 4;\r\nmat_correct = [0  1  2  3\r\n               1  0  1  2\r\n               2  1  0  1\r\n               3  2  1  0];\r\nassert(isequal(diagonalPattern(n),mat_correct))\r\n\r\n%%\r\nn = 5;\r\nmat_correct = [0  1  2  3  4\r\n               1  0  1  2  3\r\n               2  1  0  1  2\r\n               3  2  1  0  1\r\n               4  3  2  1  0];\r\nassert(isequal(diagonalPattern(n),mat_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":140356,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":482,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":41,"created_at":"2017-12-24T22:09:41.000Z","updated_at":"2026-02-14T08:55:51.000Z","published_at":"2017-12-24T22:09:41.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor a positive integer\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, return an\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enXn\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e matrix\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emat\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such that the value of each element in row\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ei\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and column\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ej\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is given according to the following rules:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ei - j\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, if\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ei \u0026gt; j\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ej - i\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, if\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ei \u0026lt; j\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e0\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, if\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ei\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e equals\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ej\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is not a positive integer,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emat\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e should be an empty matrix.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Input:  n   = 4\\nOutput: mat = [0  1  2  3\\n               1  0  1  2\\n               2  1  0  1\\n               3  2  1  0]\\n\\nInput:  n   = -2\\nOutput: mat = []\\n\\nInput:  n   = 2.5\\nOutput: mat = []]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"no_progress_badge":{"id":53,"name":"Unknown","symbol":"unknown","description":"Partially completed groups","description_html":null,"image_location":"/images/responsive/supporting/matlabcentral/cody/badges/problem_groups_unknown_2.png","bonus":null,"players_count":0,"active":false,"created_by":null,"updated_by":null,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"created_at":"2018-01-10T23:20:29.000Z","updated_at":"2018-01-10T23:20:29.000Z","community_badge_id":null,"award_multiples":false}}