{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-04-06T00:00:00.000Z","image_id":null,"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":null,"description_html":null,"published_at":null},"problems":[{"id":42590,"title":"Divide elements by sum of elements","description":"In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the same column.\r\n\r\nResults should have 2 significant digits.\r\n\r\nYou cannot use for/while loops.","description_html":"\u003cp\u003eIn this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the same column.\u003c/p\u003e\u003cp\u003eResults should have 2 significant digits.\u003c/p\u003e\u003cp\u003eYou cannot use for/while loops.\u003c/p\u003e","function_template":"function y = divideElements(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('divideElements.m');\r\nassert(isempty(strfind(filetext, 'for')))\r\nassert(isempty(strfind(filetext, 'while')))\r\n\r\n%%\r\nx = magic(3);\r\ny_correct = [0.53 0.07 0.4;\r\n0.20 0.33 0.47;\r\n0.27 0.60 0.13];\r\nassert(isequal(divideElements(x),y_correct))\r\n\r\n%%\r\nx = magic(4);\r\ny_correct = [0.47\t0.06\t0.09\t0.38\r\n0.15\t0.32\t0.29\t0.24\r\n0.26\t0.21\t0.18\t0.35\r\n0.12\t0.41\t0.44\t0.03];\r\nassert(isequal(divideElements(x),y_correct))\r\n\r\n%%\r\nx = ones(2);\r\ny_correct = repmat(0.5,2,2);\r\nassert(isequal(divideElements(x),y_correct))\r\n\r\n%%\r\nx = [1 0.5; 2 1];\r\ny_correct = [0.33 0.33; 0.67 0.67];\r\nassert(isequal(divideElements(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":142,"test_suite_updated_at":"2015-09-09T15:27:51.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-09T14:33:16.000Z","updated_at":"2026-04-02T10:12:10.000Z","published_at":"2015-09-09T14:33:16.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003eIn this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the same column.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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\u003eResults should have 2 significant digits.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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\u003eYou cannot use for/while loops.\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":42695,"title":"Replace secondary diagonal elements of a square array","description":"Replace all the secondary diagonal elements of the square array A with the number n\r\n\r\nExample:\r\n\r\n A = [1 2 3\r\n      4 5 6\r\n      7 8 9]\r\n n=0\r\n\r\n Output = [1 2 0\r\n           4 0 6\r\n           0 8 9]\r\n\r\nExample 2\r\n\r\n A = 1;\r\n n = 10;\r\n\r\n Output = 10\r\n","description_html":"\u003cp\u003eReplace all the secondary diagonal elements of the square array A with the number n\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e A = [1 2 3\r\n      4 5 6\r\n      7 8 9]\r\n n=0\u003c/pre\u003e\u003cpre\u003e Output = [1 2 0\r\n           4 0 6\r\n           0 8 9]\u003c/pre\u003e\u003cp\u003eExample 2\u003c/p\u003e\u003cpre\u003e A = 1;\r\n n = 10;\u003c/pre\u003e\u003cpre\u003e Output = 10\u003c/pre\u003e","function_template":"function B = sec_diag_replacement(A,n)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [1 2 3; 4 5 6; 7 8 9];\r\nn = 10;\r\nB_correct = [1 2 10; 4 10 6; 10 8 9];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = 1;\r\nn = 10;\r\nB_correct = 10;\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = ones(4);\r\nn = 0;\r\nB_correct = [1 1 1 0; 1 1 0 1; 1 0 1 1; 0 1 1 1];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = eye(4);\r\nn = 10;\r\nB_correct = [1 0 0 10; 0 1 10 0; 0 10 1 0; 10 0 0 1];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = [1 1 2 1; 1 2 1 1; 2 1 1 1; 1 1 1 2];\r\nn = 3;\r\nB_correct = [1 1 2 3; 1 2 3 1; 2 3 1 1; 3 1 1 2];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = zeros(3);\r\nn = -1;\r\nB_correct = [0 0 -1; 0 -1 0; -1 0 0];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":4907,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":186,"test_suite_updated_at":"2017-04-19T16:58:30.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-12-17T05:29:44.000Z","updated_at":"2026-04-02T14:42:30.000Z","published_at":"2015-12-17T05:32:13.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\u003eReplace all the secondary diagonal elements of the square array A with the number n\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\u003eExample:\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[ A = [1 2 3\\n      4 5 6\\n      7 8 9]\\n n=0\\n\\n Output = [1 2 0\\n           4 0 6\\n           0 8 9]]]\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\u003eExample 2\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[ A = 1;\\n n = 10;\\n\\n Output = 10]]\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":43609,"title":"Sort rows of a matrix","description":"Sort rows of matrix A in an ascending order according to the last column\r\n\r\nExample input:\r\n\r\n  A = [1 2 3;7 8 9;4 5 6];\r\n\r\nExample output:\r\n\r\n  A = [1 2 3;4 5 6;7 8 9];\r\n","description_html":"\u003cp\u003eSort rows of matrix A in an ascending order according to the last column\u003c/p\u003e\u003cp\u003eExample input:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3;7 8 9;4 5 6];\r\n\u003c/pre\u003e\u003cp\u003eExample output:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3;4 5 6;7 8 9];\r\n\u003c/pre\u003e","function_template":"function y = your_fcn_name(A)\r\n y = ?;\r\nend","test_suite":"%%\r\nA = magic(5);\r\ny_correct = [10 12 19 21  3;\r\n             11 18 25  2  9;\r\n             17 24  1  8 15;\r\n             23  5  7 14 16;\r\n              4  6 13 20 22];\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n\r\n%%\r\nA = 1:5;\r\ny_correct = A;\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n\r\n%%\r\nA = [1:4; 9:12; 13:16; 5:8];\r\ny_correct = reshape((1:16),[4,4])';\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n\r\n%%\r\nA = (1:10)';\r\ny_correct = A;\r\nind = rand(10,1); [~,indA] = sort(ind); A = A(indA);\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n\r\n%%\r\nA = [3:7; 10:-1:6; -4:0; 2:-1:-2];\r\ny_correct = flipud(A);\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":29461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":97,"test_suite_updated_at":"2016-12-05T18:47:25.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-10-24T15:59:33.000Z","updated_at":"2026-04-01T07:37:12.000Z","published_at":"2016-10-24T15:59:33.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\u003eSort rows of matrix A in an ascending order according to the last column\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\u003eExample input:\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[A = [1 2 3;7 8 9;4 5 6];]]\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\u003eExample output:\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[A = [1 2 3;4 5 6;7 8 9];]]\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":43964,"title":"Vector to 3-Column Matrix ","description":"Consider a vector *A* such as \r\n\r\n  A = [1 2 3 3 4 5 6]\r\n\r\nCan you convert this vector to a three-column matrix like this:\r\n\r\n  M = [1 2 3\r\n       2 3 3\r\n       3 3 4\r\n       3 4 5\r\n       4 5 6]\r\n \r\n ","description_html":"\u003cp\u003eConsider a vector \u003cb\u003eA\u003c/b\u003e such as\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3 3 4 5 6]\r\n\u003c/pre\u003e\u003cp\u003eCan you convert this vector to a three-column matrix like this:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eM = [1 2 3\r\n     2 3 3\r\n     3 3 4\r\n     3 4 5\r\n     4 5 6]\r\n\u003c/pre\u003e","function_template":"function M = vector2matrix(A)\r\n\r\nend","test_suite":"%%\r\nA=[1 2 3 3 4 5 6];\r\nM=[1 2 3\r\n   2 3 3\r\n   3 3 4\r\n   3 4 5\r\n   4 5 6];\r\nassert(isequal(vector2matrix(A),M))\r\n%%\r\nA=1:100;\r\nM=[1 2 3;2 3 4;3 4 5;4 5 6;5 6 7;6 7 8;7 8 9;8 9 10;9 10 11;10 11 12;11 12 13;12 13 14;13 14 15;14 15 16;15 16 17;16 17 18;17 18 19;18 19 20;19 20 21;20 21 22;21 22 23;22 23 24;23 24 25;24 25 26;25 26 27;26 27 28;27 28 29;28 29 30;29 30 31;30 31 32;31 32 33;32 33 34;33 34 35;34 35 36;35 36 37;36 37 38;37 38 39;38 39 40;39 40 41;40 41 42;41 42 43;42 43 44;43 44 45;44 45 46;45 46 47;46 47 48;47 48 49;48 49 50;49 50 51;50 51 52;51 52 53;52 53 54;53 54 55;54 55 56;55 56 57;56 57 58;57 58 59;58 59 60;59 60 61;60 61 62;61 62 63;62 63 64;63 64 65;64 65 66;65 66 67;66 67 68;67 68 69;68 69 70;69 70 71;70 71 72;71 72 73;72 73 74;73 74 75;74 75 76;75 76 77;76 77 78;77 78 79;78 79 80;79 80 81;80 81 82;81 82 83;82 83 84;83 84 85;84 85 86;85 86 87;86 87 88;87 88 89;88 89 90;89 90 91;90 91 92;91 92 93;92 93 94;93 94 95;94 95 96;95 96 97;96 97 98;97 98 99;98 99 100]\r\nassert(isequal(vector2matrix(A),M))\r\n%%\r\nA=[8 9 5];\r\nM=[8 9 5];\r\nassert(isequal(vector2matrix(A),M))\r\n%%\r\nA=[1 9 5 4];\r\nM=[1 9 5;9 5 4];\r\nassert(isequal(vector2matrix(A),M))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":22216,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":107,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":24,"created_at":"2016-12-22T11:32:35.000Z","updated_at":"2026-04-07T09:16:23.000Z","published_at":"2016-12-22T11:32: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\u003eConsider a vector\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\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such as\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[A = [1 2 3 3 4 5 6]]]\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\u003eCan you convert this vector to a three-column matrix like this:\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 = [1 2 3\\n     2 3 3\\n     3 3 4\\n     3 4 5\\n     4 5 6]]]\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":43803,"title":"Cookie Cutters","description":"Given a larger and smaller matrix, perform element-by-element multiplication on the smaller matrix and a sub-matrix of the larger matrix with a given offset. Return that matrix. For example, given \r\n\r\n m =\r\n   [ 17  24   1   8  15\r\n     23   5   7  14  16\r\n      4   6  13  20  22\r\n     10  12  19  21   3\r\n     11  18  25   2   9 ]\r\n\r\nand \r\n\r\n n =\r\n   [ 1 1 1\r\n     1 1 1 ]\r\n\r\nand o = [2 3], the result would be\r\n\r\n    7  14  16\r\n   13  20  22\r\n\r\nThe overlap of the two matrices will always be valid, so [4 5] would not be a valid offset for this example problem.\r\n\r\n","description_html":"\u003cp\u003eGiven a larger and smaller matrix, perform element-by-element multiplication on the smaller matrix and a sub-matrix of the larger matrix with a given offset. Return that matrix. For example, given\u003c/p\u003e\u003cpre\u003e m =\r\n   [ 17  24   1   8  15\r\n     23   5   7  14  16\r\n      4   6  13  20  22\r\n     10  12  19  21   3\r\n     11  18  25   2   9 ]\u003c/pre\u003e\u003cp\u003eand\u003c/p\u003e\u003cpre\u003e n =\r\n   [ 1 1 1\r\n     1 1 1 ]\u003c/pre\u003e\u003cp\u003eand o = [2 3], the result would be\u003c/p\u003e\u003cpre\u003e    7  14  16\r\n   13  20  22\u003c/pre\u003e\u003cp\u003eThe overlap of the two matrices will always be valid, so [4 5] would not be a valid offset for this example problem.\u003c/p\u003e","function_template":"function y = cookiecutter(m,n,o)\r\n  y = x;\r\nend","test_suite":"%%\r\nm = magic(5);\r\nn = ones(2,3);\r\no = [2 3];\r\ny_correct = [7,14,16;13,20,22];\r\nassert(isequal(cookiecutter(m,n,o),y_correct))\r\n%%\r\nm = 1;\r\nn = 8;\r\no = [1 1];\r\ny_correct = 8;\r\nassert(isequal(cookiecutter(m,n,o),y_correct))\r\n%%\r\nm = magic(20);\r\nn = ones(3);\r\no = [17 17];\r\ny_correct = [64,338,339;357,43,42;377,23,22];\r\nassert(isequal(cookiecutter(m,n,o),y_correct))\r\n%%\r\nm = magic(20);\r\nn = 5.*ones(2,3);\r\no = [4 10];\r\ny_correct = [350,355,1645;450,455,1545];\r\nassert(isequal(cookiecutter(m,n,o),y_correct))\r\n%%\r\nm = magic(7);\r\nm=m(:,1:end-1);\r\nn = spiral(3);\r\no = [5 4];\r\ny_correct = [231,336,396;246,43,6;245,8,33];\r\nassert(isequal(cookiecutter(m,n,o),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":93456,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":"2017-01-04T22:57:15.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-12-13T23:29:27.000Z","updated_at":"2026-04-01T07:38:08.000Z","published_at":"2016-12-13T23:29:27.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 a larger and smaller matrix, perform element-by-element multiplication on the smaller matrix and a sub-matrix of the larger matrix with a given offset. Return that matrix. For example, given\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   [ 17  24   1   8  15\\n     23   5   7  14  16\\n      4   6  13  20  22\\n     10  12  19  21   3\\n     11  18  25   2   9 ]]]\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\u003eand\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   [ 1 1 1\\n     1 1 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\u003eand o = [2 3], the result 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[    7  14  16\\n   13  20  22]]\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 overlap of the two matrices will always be valid, so [4 5] would not be a valid offset for this example problem.\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":42854,"title":"Crunch that matrix!","description":"You are given an M x N matrix.  Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms in the new matrix are the sum of three consecutive terms on each row.  You can assume that N is evenly divisible by 3.\r\n\r\nFor example, if your original matrix is:\r\n\r\n  [1     7    13    19    25    31\r\n   2     8    14    20    26    32\r\n   3     9    15    21    27    33\r\n   4    10    16    22    28    34\r\n   5    11    17    23    29    35\r\n   6    12    18    24    30    36]\r\n\r\nthe output should be\r\n\r\n [1+ 7+13   19+25+31\r\n  2+ 8+14   20+26+32\r\n  3+ 9+15   21+27+33\r\n  4+10+16   22+28+34\r\n  5+11+17   23+29+35\r\n  6+12+18   24+30+36]\r\n\r\nor\r\n\r\n   [21    75\r\n    24    78\r\n    27    81\r\n    30    84\r\n    33    87\r\n    36    90]\r\n\r\nGood luck!","description_html":"\u003cp\u003eYou are given an M x N matrix.  Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms in the new matrix are the sum of three consecutive terms on each row.  You can assume that N is evenly divisible by 3.\u003c/p\u003e\u003cp\u003eFor example, if your original matrix is:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1     7    13    19    25    31\r\n 2     8    14    20    26    32\r\n 3     9    15    21    27    33\r\n 4    10    16    22    28    34\r\n 5    11    17    23    29    35\r\n 6    12    18    24    30    36]\r\n\u003c/pre\u003e\u003cp\u003ethe output should be\u003c/p\u003e\u003cpre\u003e [1+ 7+13   19+25+31\r\n  2+ 8+14   20+26+32\r\n  3+ 9+15   21+27+33\r\n  4+10+16   22+28+34\r\n  5+11+17   23+29+35\r\n  6+12+18   24+30+36]\u003c/pre\u003e\u003cp\u003eor\u003c/p\u003e\u003cpre\u003e   [21    75\r\n    24    78\r\n    27    81\r\n    30    84\r\n    33    87\r\n    36    90]\u003c/pre\u003e\u003cp\u003eGood luck!\u003c/p\u003e","function_template":"function y = matrix_crunch(x)\r\n  y = x;\r\nend","test_suite":"%%\r\na=reshape(1:36,6,[]);\r\nb=[sum(a(:,1:3),2) sum(a(:,4:6),2)];\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n%%\r\na=magic(9)-30;\r\nb=[sum(a(:,1:3),2) sum(a(:,4:6),2) sum(a(:,7:9),2)];\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n%%\r\na=rand(12);\r\nb=[sum(a(:,1:3),2) sum(a(:,4:6),2) sum(a(:,7:9),2) sum(a(:,10:12),2)];\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n%%\r\na=ones(18);\r\nb=3*ones(18,6);\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n%%\r\na=magic(15)+j.*flipud(magic(15));\r\na=a(1:10,:)-rand(10,15);\r\nb=[sum(a(:,1:3),2) sum(a(:,4:6),2) sum(a(:,7:9),2) sum(a(:,10:12),2) sum(a(:,13:15),2)];\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":99,"test_suite_updated_at":"2016-05-25T12:10:27.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-05-17T18:03:44.000Z","updated_at":"2026-04-01T07:30:59.000Z","published_at":"2016-05-17T18:04:44.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\u003eYou are given an M x N matrix. Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms in the new matrix are the sum of three consecutive terms on each row. You can assume that N is evenly divisible by 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\u003eFor example, if your original matrix is:\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     7    13    19    25    31\\n 2     8    14    20    26    32\\n 3     9    15    21    27    33\\n 4    10    16    22    28    34\\n 5    11    17    23    29    35\\n 6    12    18    24    30    36]]]\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 output should 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[ [1+ 7+13   19+25+31\\n  2+ 8+14   20+26+32\\n  3+ 9+15   21+27+33\\n  4+10+16   22+28+34\\n  5+11+17   23+29+35\\n  6+12+18   24+30+36]]]\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\u003eor\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[   [21    75\\n    24    78\\n    27    81\\n    30    84\\n    33    87\\n    36    90]]]\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\u003eGood luck!\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":42639,"title":"Find the Final State of an Abelian Sandpile","description":"Let us define an \u003chttp://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile Abelian sand pile\u003e as a matrix that is only in a stable and final state when all of its elements are less than 4. When any of its elements is greater than 4, distribute four sand grains, one each to the elements above, below, to the left, and to the right of the offending element. Continue doing this until the matrix is stable.\r\n\r\nSo\r\n\r\n 0 0 0 \r\n 0 4 1\r\n 1 0 0\r\n\r\nwould become\r\n\r\n 0 1 0\r\n 1 0 2\r\n 1 1 0\r\n\r\nbecause the 4 in the middle is unstable and gets distributed.\r\n\r\nWhat makes this process Abelian is that the order in which you distribute the \"sand grains\" doesn't matter. This gives you considerable algorithmic freedom.\r\n\r\nSo, given an input matrix A, return the resulting stable Abelian sand pile matrix B.\r\n\r\nNote: you won't have to worry about sand grains \"falling off the edge of the table.\" The given matrix A will always be big enough to handle the resulting stable matrix B.\r\n\r\nExamples\r\n\r\n A = [ 0 0 0 0\r\n       0 4 4 0\r\n       0 0 0 0 ]\r\n\r\n B = [ 0 1 1 0\r\n       1 1 1 1\r\n       0 1 1 0 ]\r\n\r\nand\r\n\r\n A = [ 0 0 0\r\n       0 9 0\r\n       0 0 0 ] \r\n\r\n B = [ 0 2 0\r\n       2 1 2\r\n       0 2 0 ]\r\n\r\n\r\n","description_html":"\u003cp\u003eLet us define an \u003ca href = \"http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile\"\u003eAbelian sand pile\u003c/a\u003e as a matrix that is only in a stable and final state when all of its elements are less than 4. When any of its elements is greater than 4, distribute four sand grains, one each to the elements above, below, to the left, and to the right of the offending element. Continue doing this until the matrix is stable.\u003c/p\u003e\u003cp\u003eSo\u003c/p\u003e\u003cpre\u003e 0 0 0 \r\n 0 4 1\r\n 1 0 0\u003c/pre\u003e\u003cp\u003ewould become\u003c/p\u003e\u003cpre\u003e 0 1 0\r\n 1 0 2\r\n 1 1 0\u003c/pre\u003e\u003cp\u003ebecause the 4 in the middle is unstable and gets distributed.\u003c/p\u003e\u003cp\u003eWhat makes this process Abelian is that the order in which you distribute the \"sand grains\" doesn't matter. This gives you considerable algorithmic freedom.\u003c/p\u003e\u003cp\u003eSo, given an input matrix A, return the resulting stable Abelian sand pile matrix B.\u003c/p\u003e\u003cp\u003eNote: you won't have to worry about sand grains \"falling off the edge of the table.\" The given matrix A will always be big enough to handle the resulting stable matrix B.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e A = [ 0 0 0 0\r\n       0 4 4 0\r\n       0 0 0 0 ]\u003c/pre\u003e\u003cpre\u003e B = [ 0 1 1 0\r\n       1 1 1 1\r\n       0 1 1 0 ]\u003c/pre\u003e\u003cp\u003eand\u003c/p\u003e\u003cpre\u003e A = [ 0 0 0\r\n       0 9 0\r\n       0 0 0 ] \u003c/pre\u003e\u003cpre\u003e B = [ 0 2 0\r\n       2 1 2\r\n       0 2 0 ]\u003c/pre\u003e","function_template":"function B = sandpile(A)\r\n  B = zeros(size(A));\r\nend","test_suite":"%%\r\nA = 1;\r\nB_correct = 1;\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n%%\r\nA = [0 0 0;0 4 1;1 0 0];\r\nB_correct  = [0 1 0;1 0 2;1 1 0];\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n%%\r\nA = [0 0 0 0;0 4 4 0;0 0 0 0];\r\nB_correct = [0 1 1 0;1 1 1 1;0 1 1 0];\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n%%\r\nA = [0 0 0 0 0;0 0 0 0 0;0 0 17 0 0;0 0 0 7 0;0 0 0 0 0];\r\nB_correct = [0 0 1 0 0;0 2 1 2 0;1 1 1 3 1;0 2 3 1 2;0 0 1 2 0];\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n%%\r\nA = [0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 16 2 3 13 0 0 0 0;0 0 0 5 11 10 8 0 0 0 0;0 0 0 9 7 6 12 0 0 0 0;0 0 0 4 14 15 1 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0];\r\nB_correct = [0 0 0 0 0 0 0 0 0 0 0;0 0 1 3 3 3 3 1 0 0 0;0 2 3 2 3 3 2 3 2 0 0;1 1 1 3 2 3 1 1 1 1 0;1 3 1 1 3 3 1 2 3 1 0;1 3 0 3 3 3 3 1 3 1 0;1 0 3 2 2 3 0 3 0 1 0;0 2 2 3 2 2 3 2 2 0 0;0 0 2 0 3 3 0 2 0 0 0;0 0 0 1 1 1 1 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0];\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":74,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-29T20:59:19.000Z","updated_at":"2026-04-01T07:15:49.000Z","published_at":"2015-09-29T23:01:28.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\u003eLet us define an\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=\\\"http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAbelian sand pile\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e as a matrix that is only in a stable and final state when all of its elements are less than 4. When any of its elements is greater than 4, distribute four sand grains, one each to the elements above, below, to the left, and to the right of the offending element. Continue doing this until the matrix is stable.\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\u003eSo\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[ 0 0 0 \\n 0 4 1\\n 1 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\u003ewould become\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[ 0 1 0\\n 1 0 2\\n 1 1 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\u003ebecause the 4 in the middle is unstable and gets distributed.\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\u003eWhat makes this process Abelian is that the order in which you distribute the \\\"sand grains\\\" doesn't matter. This gives you considerable algorithmic freedom.\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\u003eSo, given an input matrix A, return the resulting stable Abelian sand pile matrix B.\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\u003eNote: you won't have to worry about sand grains \\\"falling off the edge of the table.\\\" The given matrix A will always be big enough to handle the resulting stable matrix B.\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[ A = [ 0 0 0 0\\n       0 4 4 0\\n       0 0 0 0 ]\\n\\n B = [ 0 1 1 0\\n       1 1 1 1\\n       0 1 1 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\u003eand\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[ A = [ 0 0 0\\n       0 9 0\\n       0 0 0 ] \\n\\n B = [ 0 2 0\\n       2 1 2\\n       0 2 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":42763,"title":"Fill the Matrix - 2","description":"Input is a column vector and n.\r\n\r\nn columns will be added to the left of the input column. The first value of the row is the mean of the previous row. The matrix should be filled as follows.\r\n\r\n input matrix = [1:8]'\r\n n = 4;\r\n output = \r\n [\r\n 0      0      0      0      1\r\n 0.2    0      0      0      2\r\n 0.44   0.2    0      0      3\r\n 0.7280 0.44   0.2    0      4\r\n 1.0736 0.7280 0.44   0.2    5\r\n 1.4883 1.0736 0.7280 0.44   6\r\n 1.9460 1.4883 1.0736 0.7280 7\r\n 2.4472 1.9460 1.4883 1.0736 8\r\n ];\r\n\r\nI request you to use the mean( ) function.","description_html":"\u003cp\u003eInput is a column vector and n.\u003c/p\u003e\u003cp\u003en columns will be added to the left of the input column. The first value of the row is the mean of the previous row. The matrix should be filled as follows.\u003c/p\u003e\u003cpre\u003e input matrix = [1:8]'\r\n n = 4;\r\n output = \r\n [\r\n 0      0      0      0      1\r\n 0.2    0      0      0      2\r\n 0.44   0.2    0      0      3\r\n 0.7280 0.44   0.2    0      4\r\n 1.0736 0.7280 0.44   0.2    5\r\n 1.4883 1.0736 0.7280 0.44   6\r\n 1.9460 1.4883 1.0736 0.7280 7\r\n 2.4472 1.9460 1.4883 1.0736 8\r\n ];\u003c/pre\u003e\u003cp\u003eI request you to use the mean( ) function.\u003c/p\u003e","function_template":"function y = fillMatrix2(x,n)\r\n   x= [zeros(length(x),n) x];\r\nend","test_suite":"%%\r\nx = [1:8]';\r\nn = 4;\r\ny_correct = [\r\n0 0 0 0 1;\r\n0.2 0 0 0 2;\r\n0.44 0.2 0 0 3;\r\n0.728 0.44 0.2 0 4;\r\n1.07360 0.728 0.44 0.2 5;\r\n1.48832 1.07360 0.728 0.44 6;\r\n1.945984 1.48832 1.07360 0.728 7;\r\n2.4471808 1.945984 1.48832 1.07360 8];\r\n\r\ny = fillMatrix2(x,n);\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n%%\r\nx =    [0.9649;\r\n    0.1576;\r\n    0.9706;\r\n    0.9572;\r\n    0.4854;\r\n    0.8003;\r\n    0.1419;\r\n    0.4218;\r\n    0.9157];\r\nn = 10;\r\ny_correct = [0 0 0 0 0 0 0 0 0 0 0.9649;0.0877 0 0 0 0 0 0 0 0 0 0.1576;0.0223 0.0877 0 0 0 0 0 0 0 0 0.9706;0.0982 0.0223 0.0877 0 0 0 0 0 0 0 0.9572;0.106 0.0982 0.0223 0.0877 0 0 0 0 0 0 0.4854;0.0727 0.106 0.0982 0.0223 0.0877 0 0 0 0 0 0.8003;0.1079 0.0727 0.106 0.0982 0.0223 0.0877 0 0 0 0 0.1419;0.0579 0.1079 0.0727 0.106 0.0982 0.0223 0.0877 0 0 0 0.4218;0.0886 0.0579 0.1079 0.0727 0.106 0.0982 0.0223 0.0877 0 0 0.9157;];\r\n\r\n\r\ny = fillMatrix2(x,n);\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n\r\n%% \r\nx = [1:20]';\r\nn = 0;\r\ny_correct = [1:20]';\r\n\r\ny = fillMatrix2(x,n);\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n\r\n\r\n%%\r\nx = [0.7922;-0.9595;-0.6557;0.03570;0.8491;0.9340;0.6787;-0.7577;0.7431;0.3922;-0.6555;0.1712;0.7060;-0.03180;0.2769;-0.04620;0.09710;0.8235;-0.6948;0.3171];\r\nn = 4;\r\n\r\ny_correct = [0 0 0 0 0.7922;0.1584 0 0 0 -0.9595;-0.1602 0.1584 0 0 -0.6557;-0.1315 -0.1602 0.1584 0 0.0357;-0.0195 -0.1315 -0.1602 0.1584 0.8491;0.1393 -0.0195 -0.1315 -0.1602 0.934;0.1524 0.1393 -0.0195 -0.1315 0.6787;0.1639 0.1524 0.1393 -0.0195 -0.7577;-0.0643 0.1639 0.1524 0.1393 0.7431;0.2269 -0.0643 0.1639 0.1524 0.3922;0.1742 0.2269 -0.0643 0.1639 -0.6555;-0.0310 0.1742 0.2269 -0.0643 0.1712;0.0954 -0.0310 0.1742 0.2269 0.706;0.2343 0.0954 -0.0310 0.1742 -0.0318;0.0882 0.2343 0.0954 -0.0310 0.2769;0.1328 0.0882 0.2343 0.0954 -0.0462;0.1009 0.1328 0.0882 0.2343 0.0971;0.1307 0.1009 0.1328 0.0882 0.8235;0.2552 0.1307 0.1009 0.1328 -0.6948;-0.0151 0.2552 0.1307 0.1009 0.3171];\r\n\r\ny = fillMatrix2(x,n);\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2016-03-06T08:47:45.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-03-06T08:44:13.000Z","updated_at":"2026-04-01T07:27:08.000Z","published_at":"2016-03-06T08:44:13.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\u003eInput is a column vector and n.\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 columns will be added to the left of the input column. The first value of the row is the mean of the previous row. The matrix should be filled 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[ input matrix = [1:8]'\\n n = 4;\\n output = \\n [\\n 0      0      0      0      1\\n 0.2    0      0      0      2\\n 0.44   0.2    0      0      3\\n 0.7280 0.44   0.2    0      4\\n 1.0736 0.7280 0.44   0.2    5\\n 1.4883 1.0736 0.7280 0.44   6\\n 1.9460 1.4883 1.0736 0.7280 7\\n 2.4472 1.9460 1.4883 1.0736 8\\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\u003eI request you to use the mean( ) function.\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":42858,"title":"Block average ignoring NaN values","description":"Given a matrix, calculate the block average of each disjoint sub-matrix while ignoring *NaN* values. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\r\n\r\n* Input: matrix *A* and the size of each sub-matrix *subsz*\r\n* Output: *B = blknanavg(A,subsz)*\r\n    \r\n\r\nExample:\r\n\r\n    A = [1 2 3 4 5 6 7 8 NaN];\r\n    subsz = [1  3];\r\n    B = [2  5  (7+8)/2];\r\n\r\nHint: this is related to \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42856-block-average Problem 42856. Block average\u003e.","description_html":"\u003cp\u003eGiven a matrix, calculate the block average of each disjoint sub-matrix while ignoring \u003cb\u003eNaN\u003c/b\u003e values. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\u003c/p\u003e\u003cul\u003e\u003cli\u003eInput: matrix \u003cb\u003eA\u003c/b\u003e and the size of each sub-matrix \u003cb\u003esubsz\u003c/b\u003e\u003c/li\u003e\u003cli\u003eOutput: \u003cb\u003eB = blknanavg(A,subsz)\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e    A = [1 2 3 4 5 6 7 8 NaN];\r\n    subsz = [1  3];\r\n    B = [2  5  (7+8)/2];\u003c/pre\u003e\u003cp\u003eHint: this is related to \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42856-block-average\"\u003eProblem 42856. Block average\u003c/a\u003e.\u003c/p\u003e","function_template":"function B = blknanavg(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [1 2 3 4 5 6 7 8 NaN];\r\nsubsz = [1  3];\r\nB = [2  5  (7+8)/2];\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = [1 2 3 4 NaN 6 7 NaN 9].';\r\nsubsz = [3,1];\r\nB = [2 5 8].';\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = [1       1     1       2     NaN       2\r\n     1     NaN     1     NaN       2     NaN\r\n     3       3     3     NaN     NaN     4\r\n     3       3     3     NaN       4     4];\r\nsubsz = [2   3];\r\nB = [1    2\r\n     3    4];\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = rand(100,300);\r\nA(randperm(numel(A),10)) = NaN;\r\nsubsz = size(A);\r\nB = mean(A(:),'omitnan');\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nsubsz = [4,6];\r\nB = 10*rand(10,20);\r\nA = repelem(B,subsz(1),subsz(2));\r\nA(randperm(numel(A),10)) = NaN;\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":24,"created_at":"2016-05-21T19:53:06.000Z","updated_at":"2026-04-06T19:37:34.000Z","published_at":"2016-05-21T20:04:51.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 a matrix, calculate the block average of each disjoint sub-matrix while ignoring\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\u003eNaN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e values. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\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\u003eInput: 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and the size of each sub-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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esubsz\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\u003eOutput:\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\u003eB = blknanavg(A,subsz)\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\u003eExample:\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[    A = [1 2 3 4 5 6 7 8 NaN];\\n    subsz = [1  3];\\n    B = [2  5  (7+8)/2];]]\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\u003eHint: this is related to\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42856-block-average\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 42856. Block average\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42761,"title":"Fill the matrix - 1","description":"Input is a column vector and n. \r\n\r\nn columns will be added to the left of the input column. The first value of the row is the sum of the previous row. The matrix will be filled as follow;\r\n\r\n input matrix = [1:8]'\r\n n = 4;\r\n\r\n output = \r\n [\r\n 0\t0\t0\t0\t1\r\n 1\t0\t0\t0\t2\r\n 3\t1\t0\t0\t3\r\n 7\t3\t1\t0\t4\r\n 15\t7\t3\t1\t5\r\n 31\t15\t7\t3\t6\r\n 62\t31\t15\t7\t7\r\n 122\t62\t31\t15\t8\r\n ];\r\n\r\nI request you to use sum( ) function.","description_html":"\u003cp\u003eInput is a column vector and n.\u003c/p\u003e\u003cp\u003en columns will be added to the left of the input column. The first value of the row is the sum of the previous row. The matrix will be filled as follow;\u003c/p\u003e\u003cpre\u003e input matrix = [1:8]'\r\n n = 4;\u003c/pre\u003e\u003cpre\u003e output = \r\n [\r\n 0\t0\t0\t0\t1\r\n 1\t0\t0\t0\t2\r\n 3\t1\t0\t0\t3\r\n 7\t3\t1\t0\t4\r\n 15\t7\t3\t1\t5\r\n 31\t15\t7\t3\t6\r\n 62\t31\t15\t7\t7\r\n 122\t62\t31\t15\t8\r\n ];\u003c/pre\u003e\u003cp\u003eI request you to use sum( ) function.\u003c/p\u003e","function_template":"function y = fillMatrix(x,n)\r\n  x= [zeros(length(x),n) x];\r\nend","test_suite":"%%\r\nx = [1:8]';\r\nn = 4;\r\ny_correct = [\r\n0\t0\t0\t0\t1\r\n1\t0\t0\t0\t2\r\n3\t1\t0\t0\t3\r\n7\t3\t1\t0\t4\r\n15\t7\t3\t1\t5\r\n31\t15\t7\t3\t6\r\n62\t31\t15\t7\t7\r\n122\t62\t31\t15\t8\r\n];\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n%%\r\nx = [1.584;-1.015;8.4587;6.0147;9.0258;-10.4785];\r\nn = 4;\r\ny_correct = [\r\n0\t0\t0\t0\t1.584\r\n1.584\t0\t0\t0\t-1.015\r\n0.569\t1.584\t0\t0\t8.4587\r\n10.6117\t0.569\t1.584\t0\t6.0147\r\n18.7794\t10.6117\t0.569\t1.584\t9.0258\r\n40.5699\t18.7794\t10.6117\t0.569\t-10.4785\r\n];\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n\r\n%%\r\nx = [-2:10]';\r\nn = 3;\r\ny_correct = [\r\n0\t0\t0\t-2\r\n-2\t0\t0\t-1\r\n-3\t-2\t0\t0\r\n-5\t-3\t-2\t1\r\n-9\t-5\t-3\t2\r\n-15\t-9\t-5\t3\r\n-26\t-15\t-9\t4\r\n-46\t-26\t-15\t5\r\n-82\t-46\t-26\t6\r\n-148\t-82\t-46\t7\r\n-269\t-148\t-82\t8\r\n-491\t-269\t-148\t9\r\n-899\t-491\t-269\t10\r\n];\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n%%\r\nx = [-2:10]';\r\nn = 0;\r\ny_correct = x;\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n%%\r\nx = [0.814723686393179;0.905791937075619;0.126986816293506;0.913375856139019;0.632359246225410;0.0975404049994095;0.278498218867048;0.546881519204984;0.957506835434298;0.964888535199277];\r\nn = 8;\r\ny_correct = [0 0 0 0 0 0 0 0 0.814723686393179;0.814723686393179 0 0 0 0 0 0 0 0.905791937075619;1.72051562346880 0.814723686393179 0 0 0 0 0 0 0.126986816293506;2.66222612615548 1.72051562346880 0.814723686393179 0 0 0 0 0 0.913375856139019;6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0 0 0 0 0.632359246225410;11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0 0 0 0.0975404049994095;23.3465131075727 11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0 0 0.278498218867048;46.8739840290130 23.3465131075727 11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0 0.546881519204984;94.0163513583640 46.8739840290130 23.3465131075727 11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0.957506835434298;188.443328032957 94.0163513583640 46.8739840290130 23.3465131075727 11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.964888535199277];\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));","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":64,"test_suite_updated_at":"2016-03-05T19:45:43.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-03-05T12:19:00.000Z","updated_at":"2026-04-01T07:22:20.000Z","published_at":"2016-03-05T12:19:00.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\u003eInput is a column vector and n.\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 columns will be added to the left of the input column. The first value of the row is the sum of the previous row. The matrix will be filled as follow;\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 matrix = [1:8]'\\n n = 4;\\n\\n output = \\n [\\n 0  0  0  0  1\\n 1  0  0  0  2\\n 3  1  0  0  3\\n 7  3  1  0  4\\n 15  7  3  1  5\\n 31  15  7  3  6\\n 62  31  15  7  7\\n 122  62  31  15  8\\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\u003eI request you to use sum( ) function.\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":43966,"title":"Matrix to 3-Column Matrix","description":"Consider a matrix *A* such as\r\n\r\n  A = [1 2 3 3 4 5 6;\r\n       2 3 4 5 6 7 8];\r\n\r\nCan you convert this matrix to a three-column matrix like this:\r\n\r\n\r\n  M=[1 2 3;\r\n     2 3 3;\r\n     3 3 4;\r\n     3 4 5;\r\n     4 5 6;\r\n     2 3 4;\r\n     3 4 5;\r\n     4 5 6;\r\n     5 6 7;\r\n     6 7 8]\r\n\r\n*hint:* please look at \r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43964-vector-to-3-column-matrix Problem 43964\u003e","description_html":"\u003cp\u003eConsider a matrix \u003cb\u003eA\u003c/b\u003e such as\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3 3 4 5 6;\r\n     2 3 4 5 6 7 8];\r\n\u003c/pre\u003e\u003cp\u003eCan you convert this matrix to a three-column matrix like this:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eM=[1 2 3;\r\n   2 3 3;\r\n   3 3 4;\r\n   3 4 5;\r\n   4 5 6;\r\n   2 3 4;\r\n   3 4 5;\r\n   4 5 6;\r\n   5 6 7;\r\n   6 7 8]\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003ehint:\u003c/b\u003e please look at  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43964-vector-to-3-column-matrix\"\u003eProblem 43964\u003c/a\u003e\u003c/p\u003e","function_template":"function M = matrix2matrix(A)\r\n\r\nend","test_suite":"%%\r\nA = [1 2 3 3 4 5 6; 2 3 4 5 6 7 8];\r\nM=[1 2 3;2 3 3;3 3 4;3 4 5;4 5 6;2 3 4;3 4 5;4 5 6;5 6 7;6 7 8]\r\nassert(isequal(matrix2matrix(A),M))\r\n%%\r\nA=imread('http://www.mathworks.com/matlabcentral/profiles/3374772.jpg');\r\nA=rgb2gray(A);\r\nA=A(1:20, 1:20);\r\nM=[192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 192;193 192 193;192 193 194;193 194 195;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 192;193 192 193;192 193 194;193 194 194;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 192;193 192 192;192 192 193;192 193 194;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 191;193 191 192;191 192 193;192 193 194;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 191;193 191 192;191 192 193;192 193 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 191;193 191 191;191 191 192;191 192 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 190;193 190 191;190 191 192;191 192 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 190;193 190 191;190 191 192;191 192 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 192;193 192 192;192 192 192;192 192 192;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 192;193 192 192;192 192 192;192 192 192;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 193;192 193 193;193 193 193;193 193 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 193;192 193 193;193 193 193;193 193 193;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 192;191 192 192;192 192 192;192 192 192;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 190;191 190 190;190 190 190;190 190 190;190 189 189;189 189 188;189 188 188;188 188 189;188 189 189;189 189 190;189 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 189 189;189 189 188;189 188 188;188 188 189;188 189 189;189 189 190;189 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;189 189 188;189 188 188;188 188 188;188 188 188;188 188 189;188 189 189;189 189 190;189 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;189 189 188;189 188 187;188 187 187;187 187 188;187 188 189;188 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189];\r\nassert(isequal(matrix2matrix(A),M))\r\n%%\r\nA = [1 2 3];\r\nM=[1 2 3];\r\nassert(isequal(matrix2matrix(A),M))\r\n%%\r\nA = [1 2 3;2 3 4];\r\nM=A;\r\nassert(isequal(matrix2matrix(A),M))\r\n%%\r\nA = rand(1000000,3);\r\nM=A;\r\nassert(isequal(matrix2matrix(A),M))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":22216,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":55,"test_suite_updated_at":"2016-12-23T10:22:14.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-12-23T10:05:58.000Z","updated_at":"2026-04-01T07:39:52.000Z","published_at":"2016-12-23T10:20:46.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\u003eConsider a 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such as\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[A = [1 2 3 3 4 5 6;\\n     2 3 4 5 6 7 8];]]\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\u003eCan you convert this matrix to a three-column matrix like this:\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=[1 2 3;\\n   2 3 3;\\n   3 3 4;\\n   3 4 5;\\n   4 5 6;\\n   2 3 4;\\n   3 4 5;\\n   4 5 6;\\n   5 6 7;\\n   6 7 8]]]\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ehint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e please look 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/43964-vector-to-3-column-matrix\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 43964\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42798,"title":"Moving Product (Easy)","description":"Given an input array A, write a function *movprod(A,k,dim)* to calculate the moving product over a sliding window of length *k* along the specified dimension *dim* of input array *A*. If dim is omitted, operate along the first non-singleton dimension of A. \r\n\r\nExample 1: \r\n\r\n    \u003e\u003e A = [1 2 3 4 5 6];\r\n    \u003e\u003e B = movprod(A,3)\r\n    B = \r\n       6   24   60   120\r\n\r\nExample 2: \r\n\r\n    \u003e\u003e A = [1     4     3    6    2\r\n            2     5     1    2    3\r\n            3     6     2    3    5];\r\n    \u003e\u003e B = movprod(A,3,2)\r\n    B = \r\n        12   72   36\r\n        10   10    6\r\n        36   36   30\r\n\r\n\r\nYou may assume that dim \u003c= 3, and the input array A is a non-empty array with size(A,dim) \u003e= k. \r\n\r\nRelated problems: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/429-function-on-a-moving-window Problem 429\u003e; \u003chttp://www.mathworks.com/matlabcentral/cody/problems/246-project-euler-problem-8-find-largest-product-in-a-large-string-of-numbers Problem 246\u003e\r\n\r\n*A kind note* (05/15/2017): This problem was created in 2016, one year before R2017a's introduction of the built-in movprod. To avoid function name clash, we've changed the user-defined function name into *moveprod* in the test-suite, which gives you the opportunity to solve the problem by directly calling the built-in movprod!\r\n\r\n","description_html":"\u003cp\u003eGiven an input array A, write a function \u003cb\u003emovprod(A,k,dim)\u003c/b\u003e to calculate the moving product over a sliding window of length \u003cb\u003ek\u003c/b\u003e along the specified dimension \u003cb\u003edim\u003c/b\u003e of input array \u003cb\u003eA\u003c/b\u003e. If dim is omitted, operate along the first non-singleton dimension of A.\u003c/p\u003e\u003cp\u003eExample 1:\u003c/p\u003e\u003cpre\u003e    \u0026gt;\u0026gt; A = [1 2 3 4 5 6];\r\n    \u0026gt;\u0026gt; B = movprod(A,3)\r\n    B = \r\n       6   24   60   120\u003c/pre\u003e\u003cp\u003eExample 2:\u003c/p\u003e\u003cpre\u003e    \u0026gt;\u0026gt; A = [1     4     3    6    2\r\n            2     5     1    2    3\r\n            3     6     2    3    5];\r\n    \u0026gt;\u0026gt; B = movprod(A,3,2)\r\n    B = \r\n        12   72   36\r\n        10   10    6\r\n        36   36   30\u003c/pre\u003e\u003cp\u003eYou may assume that dim \u0026lt;= 3, and the input array A is a non-empty array with size(A,dim) \u0026gt;= k.\u003c/p\u003e\u003cp\u003eRelated problems: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/429-function-on-a-moving-window\"\u003eProblem 429\u003c/a\u003e; \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/246-project-euler-problem-8-find-largest-product-in-a-large-string-of-numbers\"\u003eProblem 246\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eA kind note\u003c/b\u003e (05/15/2017): This problem was created in 2016, one year before R2017a's introduction of the built-in movprod. To avoid function name clash, we've changed the user-defined function name into \u003cb\u003emoveprod\u003c/b\u003e in the test-suite, which gives you the opportunity to solve the problem by directly calling the built-in movprod!\u003c/p\u003e","function_template":"function B = moveprod(A,k,dim)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [1 2 3 4 5 6];\r\nC = [6 24 60 120];\r\nassert(isequal(moveprod(A,3),C))\r\n\r\n%%\r\nA = [1 2 3 4 5 6].'/6;\r\nC = [2 6 12 20 30].'/6^2;\r\nB = moveprod(A,2);\r\nassert(max(abs(B-C)) \u003c= max(abs(C))*1e-12 \u0026\u0026 isequal(size(B),size(C)))\r\n\r\n%%\r\nA = [-1      4      3     6     -2\r\n      2      0      1     2     -3\r\n      3     -6     -2     3      5];\r\nC = [-2   0    3   12     6\r\n      6   0   -2    6   -15];\r\nassert(isequal(moveprod(A,2),C))\r\n\r\n%%\r\nA = [-1      4      3     6     2\r\n      2      0      1     2     3\r\n      3     -6     -2     3     5]/pi; \r\nC = [-12   72    36\r\n       0    0     6\r\n      36   36   -30]/pi^3;\r\nB = moveprod(A,3,2);\r\nassert(max(abs(B(:) - C(:))) \u003c= max(abs(C(:)))*1e-12 \u0026\u0026 isequal(size(B),size(C)))\r\n\r\n%% \r\nA = randi([-10,10],10,10,100);\r\nk = 5; dim = 3; \r\nB = moveprod(A,k,dim);\r\nszA = size(A);\r\nC = zeros(szA(1),szA(2),szA(3)-k+1);\r\nfor m = 1:szA(1)\r\n    for n = 1:szA(2)\r\n        C(m,n,:) = moveprod(squeeze(A(m,n,:)),k);\r\n    end\r\nend\r\nassert(isequal(B,C))\r\n\r\n%% \r\nA = 20*rand(10,10,100)-10;\r\nk = 4; dim = 3; \r\nB = moveprod(A,k,dim);\r\nszA = size(A);\r\nC = zeros(szA(1),szA(2),szA(3)-k+1);\r\nfor m = 1:szA(1)\r\n    for n = 1:szA(2)\r\n        C(m,n,:) = moveprod(squeeze(A(m,n,:)),k);\r\n    end\r\nend\r\nC = C + 100*eps(C);\r\nassert(max(abs(B(:) - C(:))) \u003c= max(abs(C(:)))*1e-12 \u0026\u0026 isequal(size(B),size(C)))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":"2017-05-16T00:02:52.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-04-07T20:56:32.000Z","updated_at":"2026-04-01T07:29:44.000Z","published_at":"2016-04-13T22:51:52.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 input array A, write a function\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\u003emovprod(A,k,dim)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to calculate the moving product over a sliding window of length\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\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e along the specified dimension\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\u003edim\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of input array\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\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. If dim is omitted, operate along the first non-singleton dimension of A.\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\u003eExample 1:\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[    \u003e\u003e A = [1 2 3 4 5 6];\\n    \u003e\u003e B = movprod(A,3)\\n    B = \\n       6   24   60   120]]\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\u003eExample 2:\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[    \u003e\u003e A = [1     4     3    6    2\\n            2     5     1    2    3\\n            3     6     2    3    5];\\n    \u003e\u003e B = movprod(A,3,2)\\n    B = \\n        12   72   36\\n        10   10    6\\n        36   36   30]]\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\u003eYou may assume that dim \u0026lt;= 3, and the input array A is a non-empty array with size(A,dim) \u0026gt;= k.\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\u003eRelated problems:\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/429-function-on-a-moving-window\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 429\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e;\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/246-project-euler-problem-8-find-largest-product-in-a-large-string-of-numbers\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 246\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA kind note\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (05/15/2017): This problem was created in 2016, one year before R2017a's introduction of the built-in movprod. To avoid function name clash, we've changed the user-defined function name into\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\u003emoveprod\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in the test-suite, which gives you the opportunity to solve the problem by directly calling the built-in movprod!\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":42635,"title":"Maximum of each diagonal","description":"The well-known \u003chttp://www.mathworks.com/help/matlab/ref/max.html max\u003e function can operate along either the rows or the columns of a matrix by using\r\n\r\n  [Y,I] = max(X,[],1) or [Y,I] = max(X,[],2)\r\n\r\nbut it cannot operate along a diagonal dimension. For this problem, create a function that returns the largest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the matrix).\r\n\r\n*Example*\r\n\r\nIf \r\n\r\n  X = magic(3) = [8 1 6\r\n                  3 5 7\r\n                  4 9 2]\r\n\r\nthen\r\n\r\n  Y = maxdiag(X) = [4 9 8 7 6]\r\n\r\nSee also \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42634-minimum-of-each-diagonal mindiag\u003e.","description_html":"\u003cp\u003eThe well-known \u003ca href = \"http://www.mathworks.com/help/matlab/ref/max.html\"\u003emax\u003c/a\u003e function can operate along either the rows or the columns of a matrix by using\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[Y,I] = max(X,[],1) or [Y,I] = max(X,[],2)\r\n\u003c/pre\u003e\u003cp\u003ebut it cannot operate along a diagonal dimension. For this problem, create a function that returns the largest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the matrix).\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eX = magic(3) = [8 1 6\r\n                3 5 7\r\n                4 9 2]\r\n\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eY = maxdiag(X) = [4 9 8 7 6]\r\n\u003c/pre\u003e\u003cp\u003eSee also \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42634-minimum-of-each-diagonal\"\u003emindiag\u003c/a\u003e.\u003c/p\u003e","function_template":"function y = maxdiag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isempty(maxdiag([])))\r\n\r\n%%\r\nx = randi(100);\r\nassert(isequal(maxdiag(x),x))\r\n\r\n%%\r\nx = randi(100,100,1);\r\nassert(isequal(maxdiag(x),x(end:-1:1)'))\r\n\r\n%%\r\nx = randi(100,1,100);\r\nassert(isequal(maxdiag(x),x))\r\n\r\n%%\r\nx = eye(2);\r\nassert(isequal(maxdiag(x),[0 1 0]))\r\n\r\n%%\r\nx = magic(3);\r\nassert(isequal(maxdiag(x),[4 9 8 7 6]))\r\n\r\n%%\r\nx = flipud(hankel(1:1000));\r\nassert(isequal(maxdiag(x),[1:1000,zeros(1,1000-1)]))\r\n\r\n%%\r\nx = toeplitz(1:1000);\r\nassert(isequal(maxdiag(x),[1000:-1:1,2:1000]))\r\n\r\n%%\r\nN = randi(1000);\r\nx = fliplr(toeplitz(1:N));\r\nassert(isequal(maxdiag(x),[1:N,N-1:-1:1]))\r\n\r\n%%\r\nx = magic(10);\r\nx = x(:,1:3);\r\nassert(isequal(maxdiag(x),[11 18 100 94 17 86 93 87 98 92 99 1]))\r\n\r\n%%\r\nx = hankel(-4:0,0:-2:-16);\r\nassert(isequal(maxdiag(x),[0 -1 0 -1 0 -1 0 -1 0 -2 -4 -6 -8]))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-23T23:12:25.000Z","updated_at":"2026-04-01T07:14:21.000Z","published_at":"2015-09-23T23:12:25.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\u003eThe well-known\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=\\\"http://www.mathworks.com/help/matlab/ref/max.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emax\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e function can operate along either the rows or the columns of a matrix by using\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,I] = max(X,[],1) or [Y,I] = max(X,[],2)]]\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\u003ebut it cannot operate along a diagonal dimension. For this problem, create a function that returns the largest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\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\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 = magic(3) = [8 1 6\\n                3 5 7\\n                4 9 2]]]\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\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 = maxdiag(X) = [4 9 8 7 6]]]\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 also\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42634-minimum-of-each-diagonal\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emindiag\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42856,"title":" Block average","description":"Given a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension. \r\n\r\n* Input: matrix *A* and the size of each sub-matrix *subsz*\r\n* Output: *B = blkavg(A,subsz)*\r\n\r\nExample: \r\n\r\n    A = [2  0  1  3  5  7];\r\n    subsz = [1  2];\r\n    B = [1  2  6];\r\n\r\n\r\nHint: this is related to \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42854-crunch-that-matrix Problem 42854. Crunch that matrix!\u003e.\r\n\r\nNext problem: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42858-block-average-ignoring-nan-values \r\nProblem 42858. Block average ignoring NaN values\u003e","description_html":"\u003cp\u003eGiven a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\u003c/p\u003e\u003cul\u003e\u003cli\u003eInput: matrix \u003cb\u003eA\u003c/b\u003e and the size of each sub-matrix \u003cb\u003esubsz\u003c/b\u003e\u003c/li\u003e\u003cli\u003eOutput: \u003cb\u003eB = blkavg(A,subsz)\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e    A = [2  0  1  3  5  7];\r\n    subsz = [1  2];\r\n    B = [1  2  6];\u003c/pre\u003e\u003cp\u003eHint: this is related to \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42854-crunch-that-matrix\"\u003eProblem 42854. Crunch that matrix!\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eNext problem: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42858-block-average-ignoring-nan-values\"\u003eProblem 42858. Block average ignoring NaN values\u003c/a\u003e\u003c/p\u003e","function_template":"function B = blkavg(A,subsz)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [2  0  1  3  5  7];\r\nsubsz = [1 2];\r\nB = [1 2 6];\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = [1 2 3 4 5 6 7 8 9].';\r\nsubsz = [3,1];\r\nB = [2 5 8].';\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = [1     1     1     2     2     2\r\n     1     1     1     2     2     2\r\n     3     3     3     4     4     4\r\n     3     3     3     4     4     4];\r\nsubsz = [2   3];\r\nB = [1    2\r\n     3    4];\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = rand(100,300);\r\nsubsz = size(A);\r\nB = mean(A(:));\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nsubsz = [4,6];\r\nB = 10*rand(10,20);\r\nA = repelem(B,subsz(1),subsz(2));\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":47,"test_suite_updated_at":"2016-05-21T16:50:42.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-05-21T02:56:16.000Z","updated_at":"2026-04-06T19:34:11.000Z","published_at":"2016-05-21T15:43:54.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 a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\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\u003eInput: 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and the size of each sub-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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esubsz\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\u003eOutput:\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\u003eB = blkavg(A,subsz)\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\u003eExample:\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[    A = [2  0  1  3  5  7];\\n    subsz = [1  2];\\n    B = [1  2  6];]]\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\u003eHint: this is related to\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42854-crunch-that-matrix\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 42854. Crunch that matrix!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\u003eNext problem:\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42858-block-average-ignoring-nan-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 42858. Block average ignoring NaN values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42634,"title":"Minimum of each diagonal","description":"The well-known \u003chttp://www.mathworks.com/help/matlab/ref/min.html min\u003e function can operate along either the rows or the columns of a matrix by using\r\n\r\n  [Y,I] = min(X,[],1) or [Y,I] = min(X,[],2)\r\n\r\nbut it cannot operate along a diagonal dimension. For this problem, create a function that returns the smallest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the matrix).\r\n\r\n*Example*\r\n\r\nIf \r\n\r\n  X = magic(3) = [8 1 6\r\n                  3 5 7\r\n                  4 9 2]\r\n\r\nthen\r\n\r\n  Y = mindiag(X) = [4 3 2 1 6]\r\n\r\nSee also \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42635-maximum-of-each-diagonal maxdiag\u003e.","description_html":"\u003cp\u003eThe well-known \u003ca href = \"http://www.mathworks.com/help/matlab/ref/min.html\"\u003emin\u003c/a\u003e function can operate along either the rows or the columns of a matrix by using\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[Y,I] = min(X,[],1) or [Y,I] = min(X,[],2)\r\n\u003c/pre\u003e\u003cp\u003ebut it cannot operate along a diagonal dimension. For this problem, create a function that returns the smallest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the matrix).\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eX = magic(3) = [8 1 6\r\n                3 5 7\r\n                4 9 2]\r\n\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eY = mindiag(X) = [4 3 2 1 6]\r\n\u003c/pre\u003e\u003cp\u003eSee also \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42635-maximum-of-each-diagonal\"\u003emaxdiag\u003c/a\u003e.\u003c/p\u003e","function_template":"function y = mindiag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isempty(mindiag([])))\r\n\r\n%%\r\nx = randi(100);\r\nassert(isequal(mindiag(x),x))\r\n\r\n%%\r\nx = randi(100,100,1);\r\nassert(isequal(mindiag(x),x(end:-1:1)'))\r\n\r\n%%\r\nx = randi(100,1,100);\r\nassert(isequal(mindiag(x),x))\r\n\r\n%%\r\nx = eye(2);\r\nassert(isequal(mindiag(x),[0 1 0]))\r\n\r\n%%\r\nx = magic(3);\r\nassert(isequal(mindiag(x),[4 3 2 1 6]))\r\n\r\n%%\r\nx = flipud(hankel(1:1000));\r\nassert(isequal(mindiag(x),[1:1000,zeros(1,1000-1)]))\r\n\r\n%%\r\nx = toeplitz(1:1000);\r\nassert(isequal(mindiag(x),[1000:-1:1,2:1000]))\r\n\r\n%%\r\nN = randi(1000);\r\nx = fliplr(toeplitz(1:N));\r\ny = ones(1,2*N-1);\r\ny(2:2:end) = 2;\r\nassert(isequal(mindiag(x),y))\r\n\r\n%%\r\nx = magic(10);\r\nx = x(:,1:3);\r\nassert(isequal(mindiag(x),[11 10 12 6 5 24 76 4 19 80 7 1]))\r\n\r\n%%\r\nx = hankel(-4:0,0:-2:-16);\r\nassert(isequal(mindiag(x),[0 -2 -4 -6 -8 -10 -12 -14 -16 -14 -12 -10 -8]))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":"2015-09-23T23:03:11.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-23T23:00:02.000Z","updated_at":"2026-04-01T07:12:19.000Z","published_at":"2015-09-23T23:00:02.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\u003eThe well-known\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=\\\"http://www.mathworks.com/help/matlab/ref/min.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emin\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e function can operate along either the rows or the columns of a matrix by using\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,I] = min(X,[],1) or [Y,I] = min(X,[],2)]]\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\u003ebut it cannot operate along a diagonal dimension. For this problem, create a function that returns the smallest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\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\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 = magic(3) = [8 1 6\\n                3 5 7\\n                4 9 2]]]\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\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 = mindiag(X) = [4 3 2 1 6]]]\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 also\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42635-maximum-of-each-diagonal\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emaxdiag\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":2700,"title":"Simulate one complete step in the Biham–Middleton–Levine traffic model","description":"The \u003chttp://en.wikipedia.org/wiki/Biham%E2%80%93Middleton%E2%80%93Levine_traffic_model Biham–Middleton–Levine traffic model\u003e is a simple cellular automata model loosely mimicking traffic flow. In an m-by-n domain, we see white empty space (or 0 in our matrix representation), red cars (1 in the matrix), and blue cars (2 in the matrix).\r\n\r\nAssume the space is toroidal. That is to say, the right side connects with the left, and the top connects to the bottom. So a red car that moves off the far right of the matrix re-appears on the far left.\r\n\r\nHere is a 4-by-4 version with three red cars and two blue cars.\r\n\r\n     0     0     0     2\r\n     1     1     0     0\r\n     0     0     2     0\r\n     0     0     0     1\r\n\r\nRed cars always move to the right if they are unblocked. A red car can move either into an empty space or a space being vacated by a moving red car.\r\n\r\nAfter we move the red cars (1s) we will have this matrix.\r\n\r\n     0     0     0     2\r\n     0     1     1     0\r\n     0     0     2     0\r\n     1     0     0     0\r\n\r\nWe're only halfway through the process. After we move the blue cars (2s) we end up here.\r\n\r\n     0     0     0     0\r\n     0     1     1     2\r\n     0     0     0     0\r\n     1     0     2     0\r\n\r\nThis last value of the matrix would be the return value of your function. Assume that red cars always move before blue cars.\r\n\r\nFor some visualizations of Biham–Middleton–Levine traffic, see this very nice \u003chttp://www.jasondavies.com/bml/#0.61/769/512 simulation site\u003e.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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=\"block-size: 859px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 332px 429.5px; transform-origin: 332px 429.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 31.5px; text-align: left; transform-origin: 309px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Biham%E2%80%93Middleton%E2%80%93Levine_traffic_model\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eBiham–Middleton–Levine traffic model\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e is a simple cellular automata model loosely mimicking traffic flow. In an m-by-n domain, we see white empty space (or 0 in our matrix representation), red cars (1 in the matrix), and blue cars (2 in the matrix).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 31.5px; text-align: left; transform-origin: 309px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAssume the space is toroidal. That is to say, the right side connects with the left, and the top connects to the bottom. So a red car that moves off the far right of the matrix re-appears on the far left.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHere is a 4-by-4 version with three red cars and two blue cars.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 40px; transform-origin: 329px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1     1     0     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     2     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eRed cars always move to the right if they are unblocked. A red car can move either into an empty space or a space being vacated by a moving red car.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAfter we move the red cars (1s) we will have this matrix.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 40px; transform-origin: 329px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     1     1     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     2     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1     0     0     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eWe're only halfway through the process. After we move the blue cars (2s) we end up here.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 40px; transform-origin: 329px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     1     1     2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1     0     2     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis last value of the matrix would be the return value of your function. Assume that red cars always move before blue cars.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 220px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 110px; text-align: left; transform-origin: 309px 110px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdEAAADWCAYAAACOsbiXAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AkBDysfBIlBgQAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAgAElEQVR4nOzdeZwU9Z34/1dVdXX1OT0nzAEzDAww3AMioFEkChK8UIMHbrLumqhZs2u+bpLdx2OTb3bz2P0+dh+PmE2yyS+JGl0TRRAV44X3hSIqRkC55BzO4Zh7+u6uqt8fPdXOwCA4DHO+n49HO9jT01Uz9e73u+pzlWLbto0QQgghvjS1r3dACCGEGKikiAohhBDdJEVUCCGE6CYpokIIIUQ3SREVQgghukmKqBBCCNFNUkSFEEKIbpIiKoQQQnSTFFEhhBCim6SICiGEEN0kRVQIIYToJte5fHPbtlEUBYB4PM7u3bvZsGED9fX1RCIREokEHo+HQCDAsGHDOO+88ygvL8cwjJN+XogvIxaLsXPnTjZu3EhjY2M23rxeL36/n+LiYs477zxGjhyJ2+0GJN7E2XPy3Mcff0xDQ8Mp81xFRYXE3SBxTouooig0NTXx+uuv8+abb1JbW0skEsE0TSzLwrIsVFVFVVU0TSMnJ4fRo0czf/585s2bRyAQOJe7Jwah+vp6Xn31Vd5++232799PNBrFNE1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EjEYjmqYAlq+w3d3y18S1UT44dBhJVigWJdY9+BB/9u0ngDLtHV082LIS891WPfoTY/majQiCA8r3R5WhWyEIhq/wt9vb7pTR4QEOf/gxiqpRlGQ2bXmEJ7Y9BuUy3ctX4e9Yo8td6ejcBboU2m2QZYlcNk9dfQMmk+E2Nhcm093deBRFIZ1OoygKZrMZt8dzU2avzp8OklQknxcr/mYU7th2pyiyTCqdRlVVzGYLHo/7dx+ko6PzO9GDqI6Ojo6Ozl2irxfq6Ojo6OjcJXoQ1dHR0dHRuUv0IKqjo6Ojo3OX6EFUR0dHR0fnLtGDqI6Ojo6Ozl2iB1EdHR0dHZ275P8DngxITpAUs2UAAAAASUVORK5CYII=\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor some visualizations of Biham–Middleton–Levine traffic, see this very nice \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://www.jasondavies.com/bml/#0.61/769/512\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003esimulation site\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function a_out = traffic_step(a_in)\r\n  a_out = a_in;\r\nend","test_suite":"%%\r\na_in = ...\r\n  [0 0 0 2\r\n   1 1 0 0\r\n   0 0 2 0\r\n   0 0 0 1];\r\na_out_correct = ...\r\n  [0 0 0 0\r\n   0 1 1 2\r\n   0 0 0 0\r\n   1 0 2 0];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in = ...\r\n  [0 0 2\r\n   2 0 0];\r\na_out_correct = ...\r\n  [2 0 0\r\n   0 0 2];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in = ...\r\n  [1 0 2\r\n   2 0 0];\r\na_out_correct = ...\r\n  [2 1 0\r\n   0 0 2];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in = ...\r\n  [0 0 2\r\n   1 1 1\r\n   2 0 0];\r\na_out_correct = ...\r\n  [2 0 2\r\n   1 1 1\r\n   0 0 0];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in = ...\r\n    [0     2     2     2     0     0\r\n     1     1     0     2     0     0\r\n     0     0     0     0     2     0\r\n     1     1     0     1     1     2\r\n     0     0     1     2     0     0\r\n     0     0     0     2     0     1];\r\na_out_correct = ...\r\n    [0     2     2     2     0     0\r\n     0     1     1     2     0     0\r\n     0     0     0     2     2     0\r\n     0     1     1     1     1     0\r\n     0     0     1     0     0     2\r\n     1     0     0     2     0     0];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in =  ...\r\n    [0 1 1 1\r\n     0 0 0 0];\r\na_out_correct = ...\r\n    [1 0 1 1\r\n     0 0 0 0];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in =  ...\r\n    [0\r\n     2\r\n     2];\r\na_out_correct = ...\r\n    [2\r\n     0\r\n     2];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":36,"test_suite_updated_at":"2014-12-04T15:56:53.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2014-12-01T23:45:31.000Z","updated_at":"2026-03-29T06:52:52.000Z","published_at":"2014-12-02T19:28:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"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\u003eThe\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=\\\"http://en.wikipedia.org/wiki/Biham%E2%80%93Middleton%E2%80%93Levine_traffic_model\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eBiham–Middleton–Levine traffic model\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is a simple cellular automata model loosely mimicking traffic flow. In an m-by-n domain, we see white empty space (or 0 in our matrix representation), red cars (1 in the matrix), and blue cars (2 in the 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAssume the space is toroidal. That is to say, the right side connects with the left, and the top connects to the bottom. So a red car that moves off the far right of the matrix re-appears on the far left.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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\u003eHere is a 4-by-4 version with three red cars and two blue cars.\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[     0     0     0     2\\n     1     1     0     0\\n     0     0     2     0\\n     0     0     0     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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRed cars always move to the right if they are unblocked. A red car can move either into an empty space or a space being vacated by a moving red car.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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\u003eAfter we move the red cars (1s) we will have this 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[     0     0     0     2\\n     0     1     1     0\\n     0     0     2     0\\n     1     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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe're only halfway through the process. After we move the blue cars (2s) we end up here.\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[     0     0     0     0\\n     0     1     1     2\\n     0     0     0     0\\n     1     0     2     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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis last value of the matrix would be the return value of your function. Assume that red cars always move before blue cars.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\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\u003eFor some visualizations of Biham–Middleton–Levine traffic, see this very nice \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.jasondavies.com/bml/#0.61/769/512\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esimulation site\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdEAAADWCAYAAACOsbiXAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AkBDysfBIlBgQAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAgAElEQVR4nOzdeZwU9Z34/1dVdXX1OT0nzAEzDAww3AMioFEkChK8UIMHbrLumqhZs2u+bpLdx2OTb3bz2P0+dh+PmE2yyS+JGl0TRRAV44X3hSIqRkC55BzO4Zh7+u6uqt8fPdXOwCA4DHO+n49HO9jT01Uz9e73u+pzlWLbto0QQgghvjS1r3dACCGEGKikiAohhBDdJEVUCCGE6CYpokIIIUQ3SREVQgghukmKqB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Xon64GptwNVZm34l4jKKk0NraSmR2hk9P97F2y1aMQplD7xygwdfFurWrb9lPnQWsFgff2vowhw4fo6enC6/bhs8fwOcPVL8TCIQILHyk0d1Eo3tB3NrT5MXTtOCf9fUN1Z9r61zU1i0IKC/GZDbT3bMQdExGMz3LVyz6hoGOZcuWHGO3O1izbl3185f9zdUYwN8TXHJMxd80XI1BlveElthcLjeu+WvH4/XhWegGbo8Pt6eyNScWjaKoGq2trUxPTdB77jxbtj+FUNI4uP8DAq2rWd3TjY6OztfjG9ET7ehZy85nDAjC/VuaVxAEjEYjmqYAlq+w3d3y18S1UT44dBhJVigWJdY9+BB/9u0ngDLtHV082LIS891WPfoTY/majQiCA8r3R5WhWyEIhq/wt9vb7pTR4QEOf/gxiqpRlGQ2bXmEJ7Y9BuUy3ctX4e9Yo8td6ejcBboU2m2QZYlcNk9dfQMmk+E2Nhcm093deBRFIZ1OoygKZrMZt8dzU2avzp8OklQknxcr/mYU7th2pyiyTCqdRlVVzGYLHo/7dx+ko6PzO9GDqI6Ojo6Ozl2irxfq6Ojo6OjcJXoQ1dHR0dHRuUv0IKqjo6Ojo3OX6EFUR0dHR0fnLtGDqI6Ojo6Ozl2iB1EdHR0dHZ275P8DngxITpAUs2UAAAAASUVORK5CYII=\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42631,"title":"Cumulative minimum of an array","description":"Find the cumulative minimum of an array without using the built-in function \u003chttp://www.mathworks.com/help/matlab/ref/cummin.html cummin\u003e (and a few others). Your function should act identically to cummin, allowing the same inputs.\r\n\r\n*Examples*\r\n\r\n  If X = [0 4 3\r\n          6 5 2]\r\n\r\n  cumin(X,1) is [0 4 3  and cumin(X,2) is [0 0 0\r\n                 0 4 2]                    6 5 2]\r\n \r\n  cumin(X,1,'reverse') is [0 4 2  and cumin(X,2,'reverse') is [0 3 3\r\n                           6 5 2]                              2 2 2]\r\n\r\n  Also,\r\n  cumin([8 9 1 10 6 1 3 6 10 10]) returns [8 8 1 1 1 1 1 1 1 1]\r\n\r\n  cumin([8 9 1 10 6 1 3 6 10 10]') returns [8 8 1 1 1 1 1 1 1 1]'\r\n\r\nSee also \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42633-cumulative-maximum-of-an-array cumax\u003e.","description_html":"\u003cp\u003eFind the cumulative minimum of an array without using the built-in function \u003ca href = \"http://www.mathworks.com/help/matlab/ref/cummin.html\"\u003ecummin\u003c/a\u003e (and a few others). Your function should act identically to cummin, allowing the same inputs.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eIf X = [0 4 3\r\n        6 5 2]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ecumin(X,1) is [0 4 3  and cumin(X,2) is [0 0 0\r\n               0 4 2]                    6 5 2]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ecumin(X,1,'reverse') is [0 4 2  and cumin(X,2,'reverse') is [0 3 3\r\n                         6 5 2]                              2 2 2]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eAlso,\r\ncumin([8 9 1 10 6 1 3 6 10 10]) returns [8 8 1 1 1 1 1 1 1 1]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ecumin([8 9 1 10 6 1 3 6 10 10]') returns [8 8 1 1 1 1 1 1 1 1]'\r\n\u003c/pre\u003e\u003cp\u003eSee also \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42633-cumulative-maximum-of-an-array\"\u003ecumax\u003c/a\u003e.\u003c/p\u003e","function_template":"function y = cumin(x,varargin)\r\n  y = [];\r\nend","test_suite":"%%\r\nfiletext = fileread('cumin.m');\r\nassert(isempty(strfind(filetext,'cummin')))\r\nassert(isempty(strfind(filetext,'cummax')))\r\nassert(isempty(strfind(filetext,'feval')))\r\n\r\n%%\r\nx = randi(100);\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))\r\n\r\n%%\r\nx = randi(100,randi([2 100]),1);\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))\r\n\r\n%%\r\nx = randi(100,1,randi([2 100]));\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))\r\n\r\n%%\r\nx = magic(10);\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))\r\n\r\n%%\r\nx = [];\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":42,"test_suite_updated_at":"2015-09-24T04:46:57.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-22T21:12:22.000Z","updated_at":"2026-04-01T07:07:43.000Z","published_at":"2015-09-23T19:24:39.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\u003eFind the cumulative minimum of an array without using the built-in function\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=\\\"http://www.mathworks.com/help/matlab/ref/cummin.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecummin\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (and a few others). Your function should act identically to cummin, allowing the same inputs.\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\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[If X = [0 4 3\\n        6 5 2]\\n\\ncumin(X,1) is [0 4 3  and cumin(X,2) is [0 0 0\\n               0 4 2]                    6 5 2]\\n\\ncumin(X,1,'reverse') is [0 4 2  and cumin(X,2,'reverse') is [0 3 3\\n                         6 5 2]                              2 2 2]\\n\\nAlso,\\ncumin([8 9 1 10 6 1 3 6 10 10]) returns [8 8 1 1 1 1 1 1 1 1]\\n\\ncumin([8 9 1 10 6 1 3 6 10 10]') returns [8 8 1 1 1 1 1 1 1 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\u003eSee also\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42633-cumulative-maximum-of-an-array\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecumax\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42633,"title":"Cumulative maximum of an array","description":"Find the cumulative maximum of an array without using the built-in function cummax (and a few others). Your function should act identically to cummax, allowing the same inputs.\r\nExamples\r\nIf X = [0 4 3\r\n        6 5 2]\r\n\r\ncumax(X,1) is [0 4 3  and cumax(X,2) is [0 4 4\r\n               6 5 3]                    6 6 6]\r\n\r\ncumax(X,1,'reverse') is [6 5 3  and cumax(X,2,'reverse') is [4 4 3\r\n                         6 5 2]                              6 5 2]\r\n\r\nAlso,\r\ncumax([8 9 1 10 6 1 3 6 10 10]) returns [8 9 9 10 10 10 10 10 10 10]\r\n\r\ncumax([8 9 1 10 6 1 3 6 10 10]') returns [8 9 9 10 10 10 10 10 10 10]'\r\nSee also cumin.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 378.633px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 189.317px; transform-origin: 407px 189.317px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 234px 8px; transform-origin: 234px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the cumulative maximum of an array without using the built-in function\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ecummax\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 107px 8px; transform-origin: 107px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (and a few others). Your function should act identically to cummax, allowing the same inputs.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 33.5px 8px; transform-origin: 33.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExamples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 265.633px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 132.817px; transform-origin: 404px 132.817px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 52px 8.5px; tab-size: 4; transform-origin: 52px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 12px 8.5px; transform-origin: 12px 8.5px; \"\u003eIf \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 40px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 40px 8.5px; \"\u003eX = [0 4 3\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        6 5 2]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 184px 8.5px; tab-size: 4; transform-origin: 184px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 56px 8.5px; transform-origin: 56px 8.5px; \"\u003ecumax(X,1) is \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 128px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 128px 8.5px; \"\u003e[0 4 3  and cumax(X,2) is [0 4 4\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 188px 8.5px; tab-size: 4; transform-origin: 188px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e               6 5 3]                    6 6 6]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 264px 8.5px; tab-size: 4; transform-origin: 264px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003ecumax(X,1,\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 36px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 36px 8.5px; \"\u003e'reverse'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 20px 8.5px; transform-origin: 20px 8.5px; \"\u003e) is \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 168px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 168px 8.5px; \"\u003e[6 5 3  and cumax(X,2,'reverse') is [4 4 3\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 268px 8.5px; tab-size: 4; transform-origin: 268px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e                         6 5 2]                              6 5 2]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 20px 8.5px; tab-size: 4; transform-origin: 20px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eAlso,\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 272px 8.5px; tab-size: 4; transform-origin: 272px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 160px 8.5px; transform-origin: 160px 8.5px; \"\u003ecumax([8 9 1 10 6 1 3 6 10 10]) returns \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 112px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 112px 8.5px; \"\u003e[8 9 9 10 10 10 10 10 10 10]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 280px 8.5px; tab-size: 4; transform-origin: 280px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003ecumax([8 9 1 10 6 1 3 6 10 10]') returns \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(196, 0, 0); border-block-start-color: rgb(196, 0, 0); border-bottom-color: rgb(196, 0, 0); border-inline-end-color: rgb(196, 0, 0); border-inline-start-color: rgb(196, 0, 0); border-left-color: rgb(196, 0, 0); border-right-color: rgb(196, 0, 0); border-top-color: rgb(196, 0, 0); caret-color: rgb(196, 0, 0); color: rgb(196, 0, 0); column-rule-color: rgb(196, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(196, 0, 0); perspective-origin: 116px 8.5px; text-decoration-color: rgb(196, 0, 0); text-emphasis-color: rgb(196, 0, 0); transform-origin: 116px 8.5px; \"\u003e[8 9 9 10 10 10 10 10 10 10]'\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 27.5px 8px; transform-origin: 27.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSee also\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ecumin\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = cumaX(x,varargin)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('cumaX.m');\r\nassert(isempty(strfind(filetext,'max')))\r\nassert(isempty(strfind(filetext,'cummin')))\r\nassert(isempty(strfind(filetext,'cummax')))\r\nassert(isempty(strfind(filetext,'feval')))\r\n\r\n%%\r\nx = randi(100);\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n\r\n%%\r\nx = randi(100,randi([2 100]),1);\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n\r\n%%\r\nx = randi(100,1,randi([2 100]));\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n\r\n%%\r\nx = magic(10);\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n\r\n%%\r\nx = [];\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":5,"created_by":4793,"edited_by":223089,"edited_at":"2022-10-09T10:09:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":42,"test_suite_updated_at":"2022-10-09T10:09:17.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-23T19:36:49.000Z","updated_at":"2026-03-29T06:57:19.000Z","published_at":"2015-09-23T19:38:39.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"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\u003eFind the cumulative maximum of an array without using the built-in function\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecummax\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (and a few others). Your function should act identically to cummax, allowing the same inputs.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\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[If X = [0 4 3\\n        6 5 2]\\n\\ncumax(X,1) is [0 4 3  and cumax(X,2) is [0 4 4\\n               6 5 3]                    6 6 6]\\n\\ncumax(X,1,'reverse') is [6 5 3  and cumax(X,2,'reverse') is [4 4 3\\n                         6 5 2]                              6 5 2]\\n\\nAlso,\\ncumax([8 9 1 10 6 1 3 6 10 10]) returns [8 9 9 10 10 10 10 10 10 10]\\n\\ncumax([8 9 1 10 6 1 3 6 10 10]') returns [8 9 9 10 10 10 10 10 10 10]']]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee also\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecumin\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44080,"title":"Construct a \"diagAdiag\" matrix","description":"Construct a matrix whose elements begin from 1 and end at n^2 with the order of arrangement as shown below:\r\n\r\nFor:\r\n\r\n  n = 4\r\n\r\noutput\r\n\r\n  M = \r\n[1   2   6   7;\r\n 3   5   8   13;\r\n 4   9   12  14;\r\n 10  11  15  16]\r\n\r\nNote the elements increase and decrease along alternating diagonals with the last element being always n^2.\r\n","description_html":"\u003cp\u003eConstruct a matrix whose elements begin from 1 and end at n^2 with the order of arrangement as shown below:\u003c/p\u003e\u003cp\u003eFor:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003en = 4\r\n\u003c/pre\u003e\u003cp\u003eoutput\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eM = \r\n[1   2   6   7;\r\n3   5   8   13;\r\n4   9   12  14;\r\n10  11  15  16]\r\n\u003c/pre\u003e\u003cp\u003eNote the elements increase and decrease along alternating diagonals with the last element being always n^2.\u003c/p\u003e","function_template":"function y = diagAdiag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 3;\r\ny_correct = [1 2 6; 3 5 7;4 8 9];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n\r\n%%\r\nx = 4;\r\ny_correct = [1   2   6   7; 3   5   8   13;4   9   12  14;10  11  15  16];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = [1 2 6 7 15;3 5 8 14 16;4 9 13 17 22;10 12 18 21 23;11 19 20 24 25];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n\r\n%%\r\nx = 6;\r\ny_correct = [ 1  2  6  7 15 16;\r\n              3  5  8 14 17 26;\r\n              4  9 13 18 25 27;\r\n             10 12 19 24 28 33;\r\n             11 20 23 29 32 34;\r\n             21 22 30 31 35 36];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n\r\n%%\r\nx = 7;\r\ny_correct = [ 1  2  6  7 15 16 28;\r\n              3  5  8 14 17 27 29;\r\n              4  9 13 18 26 30 39;\r\n             10 12 19 25 31 38 40;\r\n             11 20 24 32 37 41 46;\r\n             21 23 33 36 42 45 47;\r\n             22 34 35 43 44 48 49];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":98103,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":"2017-04-19T17:09:18.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2017-03-04T19:12:05.000Z","updated_at":"2026-04-02T22:13:25.000Z","published_at":"2017-03-04T19:15:05.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\u003eConstruct a matrix whose elements begin from 1 and end at n^2 with the order of arrangement as shown below:\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:\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 = 4]]\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\u003eoutput\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[1   2   6   7;\\n3   5   8   13;\\n4   9   12  14;\\n10  11  15  16]]]\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\u003eNote the elements increase and decrease along alternating diagonals with the last element being always n^2.\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":42504,"title":"Data Regularization","description":"Provided is an m-by-n integer data matrix A whose elements are drawn arbitrarily from a set *S* = [1,2,3,...,S] for any large integer number S \u003e 1. The \"arbitrary\" manner of drawing integer numbers implies that each column of A might contain only a subset of integer numbers from *S*. Our objective is to regularize the data in A subject to the following rules: \r\n\r\nFor each column in A, \r\n\r\n* The smallest number or numbers (if there are more than one such number) are mapped to 1; \r\n* The 2nd-smallest number or numbers (if there are more than one such number) are mapped to 2;\r\n* The _k_ th-smallest number or numbers (if there are more than one such number) are mapped to _k_ .\r\n\r\nFor example, *S* = [1:8] with S = 8. Suppose the input data matrix A is \r\n \r\n  A = [2  6\r\n       5  3\r\n       5  6\r\n       3  7]\r\n\r\nThen the output matrix B is \r\n\r\n  B = [1  2 \r\n       3  1\r\n       3  2\r\n       2  3]\r\n\r\nPlease try to avoid for or while loops. Vectorized code will be more appreciated. ","description_html":"\u003cp\u003eProvided is an m-by-n integer data matrix A whose elements are drawn arbitrarily from a set \u003cb\u003eS\u003c/b\u003e = [1,2,3,...,S] for any large integer number S \u0026gt; 1. The \"arbitrary\" manner of drawing integer numbers implies that each column of A might contain only a subset of integer numbers from \u003cb\u003eS\u003c/b\u003e. Our objective is to regularize the data in A subject to the following rules:\u003c/p\u003e\u003cp\u003eFor each column in A,\u003c/p\u003e\u003cul\u003e\u003cli\u003eThe smallest number or numbers (if there are more than one such number) are mapped to 1;\u003c/li\u003e\u003cli\u003eThe 2nd-smallest number or numbers (if there are more than one such number) are mapped to 2;\u003c/li\u003e\u003cli\u003eThe \u003ci\u003ek\u003c/i\u003e th-smallest number or numbers (if there are more than one such number) are mapped to \u003ci\u003ek\u003c/i\u003e .\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eFor example, \u003cb\u003eS\u003c/b\u003e = [1:8] with S = 8. Suppose the input data matrix A is\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [2  6\r\n     5  3\r\n     5  6\r\n     3  7]\r\n\u003c/pre\u003e\u003cp\u003eThen the output matrix B is\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eB = [1  2 \r\n     3  1\r\n     3  2\r\n     2  3]\r\n\u003c/pre\u003e\u003cp\u003ePlease try to avoid for or while loops. Vectorized code will be more appreciated.\u003c/p\u003e","function_template":"function B = regular(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nfiletext = fileread('regular.m');\r\nassert(isempty(strfind(filetext, 'for')))\r\nassert(isempty(strfind(filetext, 'while')))\r\n\r\n%%\r\nA = 1;\r\nB = 1;\r\nassert(isequal(regular(A),B));\r\n\r\n%%\r\nA = [2     6\r\n     5     3\r\n     5     6\r\n     3     7];\r\nB = [1     2\r\n     3     1\r\n     3     2\r\n     2     3];\r\nassert(isequal(regular(A),B));\r\n\r\n%%\r\nA = [10    2     4     4     2\r\n     4     5     6     8     1\r\n     6     5    10     3     9\r\n     9     9     5     5     5\r\n     9    10     3     7     8];\r\nB = [4     1     2     2     2\r\n     1     2     4     5     1\r\n     2     2     5     1     5\r\n     3     3     3     3     3\r\n     3     4     1     4     4];\r\nassert(isequal(regular(A),B));\r\n\r\n%%\r\nA = randi(100,80,100);\r\nB = zeros(size(A));\r\nfor iter = 1:size(A,2)\r\n    [~, ~, B(:, iter)] = unique(A(:,iter)); \r\nend\r\nassert(isequal(regular(A),B));\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":6,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":50,"test_suite_updated_at":"2015-08-12T07:02:47.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-08-12T00:30:34.000Z","updated_at":"2026-04-02T22:09:43.000Z","published_at":"2015-08-12T00:56: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\u003eProvided is an m-by-n integer data matrix A whose elements are drawn arbitrarily from a set\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\u003eS\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = [1,2,3,...,S] for any large integer number S \u0026gt; 1. The \\\"arbitrary\\\" manner of drawing integer numbers implies that each column of A might contain only a subset of integer numbers from\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\u003eS\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Our objective is to regularize the data in A subject 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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor each column in A,\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\u003eThe smallest number or numbers (if there are more than one such number) are mapped to 1;\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\u003eThe 2nd-smallest number or numbers (if there are more than one such number) are mapped to 2;\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\u003eThe\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e th-smallest number or numbers (if there are more than one such number) are mapped to\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek\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\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example,\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\u003eS\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = [1:8] with S = 8. Suppose the input data matrix A is\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[A = [2  6\\n     5  3\\n     5  6\\n     3  7]]]\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 matrix B is\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[B = [1  2 \\n     3  1\\n     3  2\\n     2  3]]]\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\u003ePlease try to avoid for or while loops. Vectorized code will be more appreciated.\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\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":42590,"title":"Divide elements by sum of elements","description":"In this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the same column.\r\n\r\nResults should have 2 significant digits.\r\n\r\nYou cannot use for/while loops.","description_html":"\u003cp\u003eIn this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the same column.\u003c/p\u003e\u003cp\u003eResults should have 2 significant digits.\u003c/p\u003e\u003cp\u003eYou cannot use for/while loops.\u003c/p\u003e","function_template":"function y = divideElements(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('divideElements.m');\r\nassert(isempty(strfind(filetext, 'for')))\r\nassert(isempty(strfind(filetext, 'while')))\r\n\r\n%%\r\nx = magic(3);\r\ny_correct = [0.53 0.07 0.4;\r\n0.20 0.33 0.47;\r\n0.27 0.60 0.13];\r\nassert(isequal(divideElements(x),y_correct))\r\n\r\n%%\r\nx = magic(4);\r\ny_correct = [0.47\t0.06\t0.09\t0.38\r\n0.15\t0.32\t0.29\t0.24\r\n0.26\t0.21\t0.18\t0.35\r\n0.12\t0.41\t0.44\t0.03];\r\nassert(isequal(divideElements(x),y_correct))\r\n\r\n%%\r\nx = ones(2);\r\ny_correct = repmat(0.5,2,2);\r\nassert(isequal(divideElements(x),y_correct))\r\n\r\n%%\r\nx = [1 0.5; 2 1];\r\ny_correct = [0.33 0.33; 0.67 0.67];\r\nassert(isequal(divideElements(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":142,"test_suite_updated_at":"2015-09-09T15:27:51.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-09T14:33:16.000Z","updated_at":"2026-04-02T10:12:10.000Z","published_at":"2015-09-09T14:33:16.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003eIn this problem, I ask you to write a function which will divide the elements of each column by the sum of the elements of the same column.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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\u003eResults should have 2 significant digits.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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\u003eYou cannot use for/while loops.\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":42695,"title":"Replace secondary diagonal elements of a square array","description":"Replace all the secondary diagonal elements of the square array A with the number n\r\n\r\nExample:\r\n\r\n A = [1 2 3\r\n      4 5 6\r\n      7 8 9]\r\n n=0\r\n\r\n Output = [1 2 0\r\n           4 0 6\r\n           0 8 9]\r\n\r\nExample 2\r\n\r\n A = 1;\r\n n = 10;\r\n\r\n Output = 10\r\n","description_html":"\u003cp\u003eReplace all the secondary diagonal elements of the square array A with the number n\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e A = [1 2 3\r\n      4 5 6\r\n      7 8 9]\r\n n=0\u003c/pre\u003e\u003cpre\u003e Output = [1 2 0\r\n           4 0 6\r\n           0 8 9]\u003c/pre\u003e\u003cp\u003eExample 2\u003c/p\u003e\u003cpre\u003e A = 1;\r\n n = 10;\u003c/pre\u003e\u003cpre\u003e Output = 10\u003c/pre\u003e","function_template":"function B = sec_diag_replacement(A,n)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [1 2 3; 4 5 6; 7 8 9];\r\nn = 10;\r\nB_correct = [1 2 10; 4 10 6; 10 8 9];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = 1;\r\nn = 10;\r\nB_correct = 10;\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = ones(4);\r\nn = 0;\r\nB_correct = [1 1 1 0; 1 1 0 1; 1 0 1 1; 0 1 1 1];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = eye(4);\r\nn = 10;\r\nB_correct = [1 0 0 10; 0 1 10 0; 0 10 1 0; 10 0 0 1];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = [1 1 2 1; 1 2 1 1; 2 1 1 1; 1 1 1 2];\r\nn = 3;\r\nB_correct = [1 1 2 3; 1 2 3 1; 2 3 1 1; 3 1 1 2];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n\r\n%%\r\nA = zeros(3);\r\nn = -1;\r\nB_correct = [0 0 -1; 0 -1 0; -1 0 0];\r\nassert(isequal(sec_diag_replacement(A,n),B_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":4907,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":186,"test_suite_updated_at":"2017-04-19T16:58:30.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-12-17T05:29:44.000Z","updated_at":"2026-04-02T14:42:30.000Z","published_at":"2015-12-17T05:32:13.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\u003eReplace all the secondary diagonal elements of the square array A with the number n\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\u003eExample:\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[ A = [1 2 3\\n      4 5 6\\n      7 8 9]\\n n=0\\n\\n Output = [1 2 0\\n           4 0 6\\n           0 8 9]]]\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\u003eExample 2\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[ A = 1;\\n n = 10;\\n\\n Output = 10]]\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":43609,"title":"Sort rows of a matrix","description":"Sort rows of matrix A in an ascending order according to the last column\r\n\r\nExample input:\r\n\r\n  A = [1 2 3;7 8 9;4 5 6];\r\n\r\nExample output:\r\n\r\n  A = [1 2 3;4 5 6;7 8 9];\r\n","description_html":"\u003cp\u003eSort rows of matrix A in an ascending order according to the last column\u003c/p\u003e\u003cp\u003eExample input:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3;7 8 9;4 5 6];\r\n\u003c/pre\u003e\u003cp\u003eExample output:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3;4 5 6;7 8 9];\r\n\u003c/pre\u003e","function_template":"function y = your_fcn_name(A)\r\n y = ?;\r\nend","test_suite":"%%\r\nA = magic(5);\r\ny_correct = [10 12 19 21  3;\r\n             11 18 25  2  9;\r\n             17 24  1  8 15;\r\n             23  5  7 14 16;\r\n              4  6 13 20 22];\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n\r\n%%\r\nA = 1:5;\r\ny_correct = A;\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n\r\n%%\r\nA = [1:4; 9:12; 13:16; 5:8];\r\ny_correct = reshape((1:16),[4,4])';\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n\r\n%%\r\nA = (1:10)';\r\ny_correct = A;\r\nind = rand(10,1); [~,indA] = sort(ind); A = A(indA);\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n\r\n%%\r\nA = [3:7; 10:-1:6; -4:0; 2:-1:-2];\r\ny_correct = flipud(A);\r\nassert(isequal(your_fcn_name(A),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":29461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":97,"test_suite_updated_at":"2016-12-05T18:47:25.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-10-24T15:59:33.000Z","updated_at":"2026-04-01T07:37:12.000Z","published_at":"2016-10-24T15:59:33.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\u003eSort rows of matrix A in an ascending order according to the last column\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\u003eExample input:\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[A = [1 2 3;7 8 9;4 5 6];]]\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\u003eExample output:\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[A = [1 2 3;4 5 6;7 8 9];]]\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":43964,"title":"Vector to 3-Column Matrix ","description":"Consider a vector *A* such as \r\n\r\n  A = [1 2 3 3 4 5 6]\r\n\r\nCan you convert this vector to a three-column matrix like this:\r\n\r\n  M = [1 2 3\r\n       2 3 3\r\n       3 3 4\r\n       3 4 5\r\n       4 5 6]\r\n \r\n ","description_html":"\u003cp\u003eConsider a vector \u003cb\u003eA\u003c/b\u003e such as\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3 3 4 5 6]\r\n\u003c/pre\u003e\u003cp\u003eCan you convert this vector to a three-column matrix like this:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eM = [1 2 3\r\n     2 3 3\r\n     3 3 4\r\n     3 4 5\r\n     4 5 6]\r\n\u003c/pre\u003e","function_template":"function M = vector2matrix(A)\r\n\r\nend","test_suite":"%%\r\nA=[1 2 3 3 4 5 6];\r\nM=[1 2 3\r\n   2 3 3\r\n   3 3 4\r\n   3 4 5\r\n   4 5 6];\r\nassert(isequal(vector2matrix(A),M))\r\n%%\r\nA=1:100;\r\nM=[1 2 3;2 3 4;3 4 5;4 5 6;5 6 7;6 7 8;7 8 9;8 9 10;9 10 11;10 11 12;11 12 13;12 13 14;13 14 15;14 15 16;15 16 17;16 17 18;17 18 19;18 19 20;19 20 21;20 21 22;21 22 23;22 23 24;23 24 25;24 25 26;25 26 27;26 27 28;27 28 29;28 29 30;29 30 31;30 31 32;31 32 33;32 33 34;33 34 35;34 35 36;35 36 37;36 37 38;37 38 39;38 39 40;39 40 41;40 41 42;41 42 43;42 43 44;43 44 45;44 45 46;45 46 47;46 47 48;47 48 49;48 49 50;49 50 51;50 51 52;51 52 53;52 53 54;53 54 55;54 55 56;55 56 57;56 57 58;57 58 59;58 59 60;59 60 61;60 61 62;61 62 63;62 63 64;63 64 65;64 65 66;65 66 67;66 67 68;67 68 69;68 69 70;69 70 71;70 71 72;71 72 73;72 73 74;73 74 75;74 75 76;75 76 77;76 77 78;77 78 79;78 79 80;79 80 81;80 81 82;81 82 83;82 83 84;83 84 85;84 85 86;85 86 87;86 87 88;87 88 89;88 89 90;89 90 91;90 91 92;91 92 93;92 93 94;93 94 95;94 95 96;95 96 97;96 97 98;97 98 99;98 99 100]\r\nassert(isequal(vector2matrix(A),M))\r\n%%\r\nA=[8 9 5];\r\nM=[8 9 5];\r\nassert(isequal(vector2matrix(A),M))\r\n%%\r\nA=[1 9 5 4];\r\nM=[1 9 5;9 5 4];\r\nassert(isequal(vector2matrix(A),M))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":22216,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":107,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":24,"created_at":"2016-12-22T11:32:35.000Z","updated_at":"2026-04-07T09:16:23.000Z","published_at":"2016-12-22T11:32: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\u003eConsider a vector\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\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such as\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[A = [1 2 3 3 4 5 6]]]\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\u003eCan you convert this vector to a three-column matrix like this:\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 = [1 2 3\\n     2 3 3\\n     3 3 4\\n     3 4 5\\n     4 5 6]]]\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":43803,"title":"Cookie Cutters","description":"Given a larger and smaller matrix, perform element-by-element multiplication on the smaller matrix and a sub-matrix of the larger matrix with a given offset. Return that matrix. For example, given \r\n\r\n m =\r\n   [ 17  24   1   8  15\r\n     23   5   7  14  16\r\n      4   6  13  20  22\r\n     10  12  19  21   3\r\n     11  18  25   2   9 ]\r\n\r\nand \r\n\r\n n =\r\n   [ 1 1 1\r\n     1 1 1 ]\r\n\r\nand o = [2 3], the result would be\r\n\r\n    7  14  16\r\n   13  20  22\r\n\r\nThe overlap of the two matrices will always be valid, so [4 5] would not be a valid offset for this example problem.\r\n\r\n","description_html":"\u003cp\u003eGiven a larger and smaller matrix, perform element-by-element multiplication on the smaller matrix and a sub-matrix of the larger matrix with a given offset. Return that matrix. For example, given\u003c/p\u003e\u003cpre\u003e m =\r\n   [ 17  24   1   8  15\r\n     23   5   7  14  16\r\n      4   6  13  20  22\r\n     10  12  19  21   3\r\n     11  18  25   2   9 ]\u003c/pre\u003e\u003cp\u003eand\u003c/p\u003e\u003cpre\u003e n =\r\n   [ 1 1 1\r\n     1 1 1 ]\u003c/pre\u003e\u003cp\u003eand o = [2 3], the result would be\u003c/p\u003e\u003cpre\u003e    7  14  16\r\n   13  20  22\u003c/pre\u003e\u003cp\u003eThe overlap of the two matrices will always be valid, so [4 5] would not be a valid offset for this example problem.\u003c/p\u003e","function_template":"function y = cookiecutter(m,n,o)\r\n  y = x;\r\nend","test_suite":"%%\r\nm = magic(5);\r\nn = ones(2,3);\r\no = [2 3];\r\ny_correct = [7,14,16;13,20,22];\r\nassert(isequal(cookiecutter(m,n,o),y_correct))\r\n%%\r\nm = 1;\r\nn = 8;\r\no = [1 1];\r\ny_correct = 8;\r\nassert(isequal(cookiecutter(m,n,o),y_correct))\r\n%%\r\nm = magic(20);\r\nn = ones(3);\r\no = [17 17];\r\ny_correct = [64,338,339;357,43,42;377,23,22];\r\nassert(isequal(cookiecutter(m,n,o),y_correct))\r\n%%\r\nm = magic(20);\r\nn = 5.*ones(2,3);\r\no = [4 10];\r\ny_correct = [350,355,1645;450,455,1545];\r\nassert(isequal(cookiecutter(m,n,o),y_correct))\r\n%%\r\nm = magic(7);\r\nm=m(:,1:end-1);\r\nn = spiral(3);\r\no = [5 4];\r\ny_correct = [231,336,396;246,43,6;245,8,33];\r\nassert(isequal(cookiecutter(m,n,o),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":93456,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":"2017-01-04T22:57:15.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-12-13T23:29:27.000Z","updated_at":"2026-04-01T07:38:08.000Z","published_at":"2016-12-13T23:29:27.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 a larger and smaller matrix, perform element-by-element multiplication on the smaller matrix and a sub-matrix of the larger matrix with a given offset. Return that matrix. For example, given\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   [ 17  24   1   8  15\\n     23   5   7  14  16\\n      4   6  13  20  22\\n     10  12  19  21   3\\n     11  18  25   2   9 ]]]\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\u003eand\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   [ 1 1 1\\n     1 1 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\u003eand o = [2 3], the result 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[    7  14  16\\n   13  20  22]]\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 overlap of the two matrices will always be valid, so [4 5] would not be a valid offset for this example problem.\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":42854,"title":"Crunch that matrix!","description":"You are given an M x N matrix.  Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms in the new matrix are the sum of three consecutive terms on each row.  You can assume that N is evenly divisible by 3.\r\n\r\nFor example, if your original matrix is:\r\n\r\n  [1     7    13    19    25    31\r\n   2     8    14    20    26    32\r\n   3     9    15    21    27    33\r\n   4    10    16    22    28    34\r\n   5    11    17    23    29    35\r\n   6    12    18    24    30    36]\r\n\r\nthe output should be\r\n\r\n [1+ 7+13   19+25+31\r\n  2+ 8+14   20+26+32\r\n  3+ 9+15   21+27+33\r\n  4+10+16   22+28+34\r\n  5+11+17   23+29+35\r\n  6+12+18   24+30+36]\r\n\r\nor\r\n\r\n   [21    75\r\n    24    78\r\n    27    81\r\n    30    84\r\n    33    87\r\n    36    90]\r\n\r\nGood luck!","description_html":"\u003cp\u003eYou are given an M x N matrix.  Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms in the new matrix are the sum of three consecutive terms on each row.  You can assume that N is evenly divisible by 3.\u003c/p\u003e\u003cp\u003eFor example, if your original matrix is:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1     7    13    19    25    31\r\n 2     8    14    20    26    32\r\n 3     9    15    21    27    33\r\n 4    10    16    22    28    34\r\n 5    11    17    23    29    35\r\n 6    12    18    24    30    36]\r\n\u003c/pre\u003e\u003cp\u003ethe output should be\u003c/p\u003e\u003cpre\u003e [1+ 7+13   19+25+31\r\n  2+ 8+14   20+26+32\r\n  3+ 9+15   21+27+33\r\n  4+10+16   22+28+34\r\n  5+11+17   23+29+35\r\n  6+12+18   24+30+36]\u003c/pre\u003e\u003cp\u003eor\u003c/p\u003e\u003cpre\u003e   [21    75\r\n    24    78\r\n    27    81\r\n    30    84\r\n    33    87\r\n    36    90]\u003c/pre\u003e\u003cp\u003eGood luck!\u003c/p\u003e","function_template":"function y = matrix_crunch(x)\r\n  y = x;\r\nend","test_suite":"%%\r\na=reshape(1:36,6,[]);\r\nb=[sum(a(:,1:3),2) sum(a(:,4:6),2)];\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n%%\r\na=magic(9)-30;\r\nb=[sum(a(:,1:3),2) sum(a(:,4:6),2) sum(a(:,7:9),2)];\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n%%\r\na=rand(12);\r\nb=[sum(a(:,1:3),2) sum(a(:,4:6),2) sum(a(:,7:9),2) sum(a(:,10:12),2)];\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n%%\r\na=ones(18);\r\nb=3*ones(18,6);\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n%%\r\na=magic(15)+j.*flipud(magic(15));\r\na=a(1:10,:)-rand(10,15);\r\nb=[sum(a(:,1:3),2) sum(a(:,4:6),2) sum(a(:,7:9),2) sum(a(:,10:12),2) sum(a(:,13:15),2)];\r\nm=matrix_crunch(a);\r\nassert(max(max(abs(m-b)))\u003c1e-10)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1615,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":99,"test_suite_updated_at":"2016-05-25T12:10:27.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-05-17T18:03:44.000Z","updated_at":"2026-04-01T07:30:59.000Z","published_at":"2016-05-17T18:04:44.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\u003eYou are given an M x N matrix. Write a script that will compress this matrix into an M x (N/3) matrix, where each of the terms in the new matrix are the sum of three consecutive terms on each row. You can assume that N is evenly divisible by 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\u003eFor example, if your original matrix is:\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     7    13    19    25    31\\n 2     8    14    20    26    32\\n 3     9    15    21    27    33\\n 4    10    16    22    28    34\\n 5    11    17    23    29    35\\n 6    12    18    24    30    36]]]\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 output should 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[ [1+ 7+13   19+25+31\\n  2+ 8+14   20+26+32\\n  3+ 9+15   21+27+33\\n  4+10+16   22+28+34\\n  5+11+17   23+29+35\\n  6+12+18   24+30+36]]]\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\u003eor\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[   [21    75\\n    24    78\\n    27    81\\n    30    84\\n    33    87\\n    36    90]]]\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\u003eGood luck!\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":42639,"title":"Find the Final State of an Abelian Sandpile","description":"Let us define an \u003chttp://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile Abelian sand pile\u003e as a matrix that is only in a stable and final state when all of its elements are less than 4. When any of its elements is greater than 4, distribute four sand grains, one each to the elements above, below, to the left, and to the right of the offending element. Continue doing this until the matrix is stable.\r\n\r\nSo\r\n\r\n 0 0 0 \r\n 0 4 1\r\n 1 0 0\r\n\r\nwould become\r\n\r\n 0 1 0\r\n 1 0 2\r\n 1 1 0\r\n\r\nbecause the 4 in the middle is unstable and gets distributed.\r\n\r\nWhat makes this process Abelian is that the order in which you distribute the \"sand grains\" doesn't matter. This gives you considerable algorithmic freedom.\r\n\r\nSo, given an input matrix A, return the resulting stable Abelian sand pile matrix B.\r\n\r\nNote: you won't have to worry about sand grains \"falling off the edge of the table.\" The given matrix A will always be big enough to handle the resulting stable matrix B.\r\n\r\nExamples\r\n\r\n A = [ 0 0 0 0\r\n       0 4 4 0\r\n       0 0 0 0 ]\r\n\r\n B = [ 0 1 1 0\r\n       1 1 1 1\r\n       0 1 1 0 ]\r\n\r\nand\r\n\r\n A = [ 0 0 0\r\n       0 9 0\r\n       0 0 0 ] \r\n\r\n B = [ 0 2 0\r\n       2 1 2\r\n       0 2 0 ]\r\n\r\n\r\n","description_html":"\u003cp\u003eLet us define an \u003ca href = \"http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile\"\u003eAbelian sand pile\u003c/a\u003e as a matrix that is only in a stable and final state when all of its elements are less than 4. When any of its elements is greater than 4, distribute four sand grains, one each to the elements above, below, to the left, and to the right of the offending element. Continue doing this until the matrix is stable.\u003c/p\u003e\u003cp\u003eSo\u003c/p\u003e\u003cpre\u003e 0 0 0 \r\n 0 4 1\r\n 1 0 0\u003c/pre\u003e\u003cp\u003ewould become\u003c/p\u003e\u003cpre\u003e 0 1 0\r\n 1 0 2\r\n 1 1 0\u003c/pre\u003e\u003cp\u003ebecause the 4 in the middle is unstable and gets distributed.\u003c/p\u003e\u003cp\u003eWhat makes this process Abelian is that the order in which you distribute the \"sand grains\" doesn't matter. This gives you considerable algorithmic freedom.\u003c/p\u003e\u003cp\u003eSo, given an input matrix A, return the resulting stable Abelian sand pile matrix B.\u003c/p\u003e\u003cp\u003eNote: you won't have to worry about sand grains \"falling off the edge of the table.\" The given matrix A will always be big enough to handle the resulting stable matrix B.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e A = [ 0 0 0 0\r\n       0 4 4 0\r\n       0 0 0 0 ]\u003c/pre\u003e\u003cpre\u003e B = [ 0 1 1 0\r\n       1 1 1 1\r\n       0 1 1 0 ]\u003c/pre\u003e\u003cp\u003eand\u003c/p\u003e\u003cpre\u003e A = [ 0 0 0\r\n       0 9 0\r\n       0 0 0 ] \u003c/pre\u003e\u003cpre\u003e B = [ 0 2 0\r\n       2 1 2\r\n       0 2 0 ]\u003c/pre\u003e","function_template":"function B = sandpile(A)\r\n  B = zeros(size(A));\r\nend","test_suite":"%%\r\nA = 1;\r\nB_correct = 1;\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n%%\r\nA = [0 0 0;0 4 1;1 0 0];\r\nB_correct  = [0 1 0;1 0 2;1 1 0];\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n%%\r\nA = [0 0 0 0;0 4 4 0;0 0 0 0];\r\nB_correct = [0 1 1 0;1 1 1 1;0 1 1 0];\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n%%\r\nA = [0 0 0 0 0;0 0 0 0 0;0 0 17 0 0;0 0 0 7 0;0 0 0 0 0];\r\nB_correct = [0 0 1 0 0;0 2 1 2 0;1 1 1 3 1;0 2 3 1 2;0 0 1 2 0];\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n%%\r\nA = [0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 16 2 3 13 0 0 0 0;0 0 0 5 11 10 8 0 0 0 0;0 0 0 9 7 6 12 0 0 0 0;0 0 0 4 14 15 1 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0];\r\nB_correct = [0 0 0 0 0 0 0 0 0 0 0;0 0 1 3 3 3 3 1 0 0 0;0 2 3 2 3 3 2 3 2 0 0;1 1 1 3 2 3 1 1 1 1 0;1 3 1 1 3 3 1 2 3 1 0;1 3 0 3 3 3 3 1 3 1 0;1 0 3 2 2 3 0 3 0 1 0;0 2 2 3 2 2 3 2 2 0 0;0 0 2 0 3 3 0 2 0 0 0;0 0 0 1 1 1 1 0 0 0 0;0 0 0 0 0 0 0 0 0 0 0];\r\nassert(isequal(sandpile(A),B_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":74,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-29T20:59:19.000Z","updated_at":"2026-04-01T07:15:49.000Z","published_at":"2015-09-29T23:01:28.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\u003eLet us define an\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=\\\"http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eAbelian sand pile\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e as a matrix that is only in a stable and final state when all of its elements are less than 4. When any of its elements is greater than 4, distribute four sand grains, one each to the elements above, below, to the left, and to the right of the offending element. Continue doing this until the matrix is stable.\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\u003eSo\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[ 0 0 0 \\n 0 4 1\\n 1 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\u003ewould become\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[ 0 1 0\\n 1 0 2\\n 1 1 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\u003ebecause the 4 in the middle is unstable and gets distributed.\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\u003eWhat makes this process Abelian is that the order in which you distribute the \\\"sand grains\\\" doesn't matter. This gives you considerable algorithmic freedom.\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\u003eSo, given an input matrix A, return the resulting stable Abelian sand pile matrix B.\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\u003eNote: you won't have to worry about sand grains \\\"falling off the edge of the table.\\\" The given matrix A will always be big enough to handle the resulting stable matrix B.\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[ A = [ 0 0 0 0\\n       0 4 4 0\\n       0 0 0 0 ]\\n\\n B = [ 0 1 1 0\\n       1 1 1 1\\n       0 1 1 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\u003eand\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[ A = [ 0 0 0\\n       0 9 0\\n       0 0 0 ] \\n\\n B = [ 0 2 0\\n       2 1 2\\n       0 2 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":42763,"title":"Fill the Matrix - 2","description":"Input is a column vector and n.\r\n\r\nn columns will be added to the left of the input column. The first value of the row is the mean of the previous row. The matrix should be filled as follows.\r\n\r\n input matrix = [1:8]'\r\n n = 4;\r\n output = \r\n [\r\n 0      0      0      0      1\r\n 0.2    0      0      0      2\r\n 0.44   0.2    0      0      3\r\n 0.7280 0.44   0.2    0      4\r\n 1.0736 0.7280 0.44   0.2    5\r\n 1.4883 1.0736 0.7280 0.44   6\r\n 1.9460 1.4883 1.0736 0.7280 7\r\n 2.4472 1.9460 1.4883 1.0736 8\r\n ];\r\n\r\nI request you to use the mean( ) function.","description_html":"\u003cp\u003eInput is a column vector and n.\u003c/p\u003e\u003cp\u003en columns will be added to the left of the input column. The first value of the row is the mean of the previous row. The matrix should be filled as follows.\u003c/p\u003e\u003cpre\u003e input matrix = [1:8]'\r\n n = 4;\r\n output = \r\n [\r\n 0      0      0      0      1\r\n 0.2    0      0      0      2\r\n 0.44   0.2    0      0      3\r\n 0.7280 0.44   0.2    0      4\r\n 1.0736 0.7280 0.44   0.2    5\r\n 1.4883 1.0736 0.7280 0.44   6\r\n 1.9460 1.4883 1.0736 0.7280 7\r\n 2.4472 1.9460 1.4883 1.0736 8\r\n ];\u003c/pre\u003e\u003cp\u003eI request you to use the mean( ) function.\u003c/p\u003e","function_template":"function y = fillMatrix2(x,n)\r\n   x= [zeros(length(x),n) x];\r\nend","test_suite":"%%\r\nx = [1:8]';\r\nn = 4;\r\ny_correct = [\r\n0 0 0 0 1;\r\n0.2 0 0 0 2;\r\n0.44 0.2 0 0 3;\r\n0.728 0.44 0.2 0 4;\r\n1.07360 0.728 0.44 0.2 5;\r\n1.48832 1.07360 0.728 0.44 6;\r\n1.945984 1.48832 1.07360 0.728 7;\r\n2.4471808 1.945984 1.48832 1.07360 8];\r\n\r\ny = fillMatrix2(x,n);\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n%%\r\nx =    [0.9649;\r\n    0.1576;\r\n    0.9706;\r\n    0.9572;\r\n    0.4854;\r\n    0.8003;\r\n    0.1419;\r\n    0.4218;\r\n    0.9157];\r\nn = 10;\r\ny_correct = [0 0 0 0 0 0 0 0 0 0 0.9649;0.0877 0 0 0 0 0 0 0 0 0 0.1576;0.0223 0.0877 0 0 0 0 0 0 0 0 0.9706;0.0982 0.0223 0.0877 0 0 0 0 0 0 0 0.9572;0.106 0.0982 0.0223 0.0877 0 0 0 0 0 0 0.4854;0.0727 0.106 0.0982 0.0223 0.0877 0 0 0 0 0 0.8003;0.1079 0.0727 0.106 0.0982 0.0223 0.0877 0 0 0 0 0.1419;0.0579 0.1079 0.0727 0.106 0.0982 0.0223 0.0877 0 0 0 0.4218;0.0886 0.0579 0.1079 0.0727 0.106 0.0982 0.0223 0.0877 0 0 0.9157;];\r\n\r\n\r\ny = fillMatrix2(x,n);\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n\r\n%% \r\nx = [1:20]';\r\nn = 0;\r\ny_correct = [1:20]';\r\n\r\ny = fillMatrix2(x,n);\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n\r\n\r\n%%\r\nx = [0.7922;-0.9595;-0.6557;0.03570;0.8491;0.9340;0.6787;-0.7577;0.7431;0.3922;-0.6555;0.1712;0.7060;-0.03180;0.2769;-0.04620;0.09710;0.8235;-0.6948;0.3171];\r\nn = 4;\r\n\r\ny_correct = [0 0 0 0 0.7922;0.1584 0 0 0 -0.9595;-0.1602 0.1584 0 0 -0.6557;-0.1315 -0.1602 0.1584 0 0.0357;-0.0195 -0.1315 -0.1602 0.1584 0.8491;0.1393 -0.0195 -0.1315 -0.1602 0.934;0.1524 0.1393 -0.0195 -0.1315 0.6787;0.1639 0.1524 0.1393 -0.0195 -0.7577;-0.0643 0.1639 0.1524 0.1393 0.7431;0.2269 -0.0643 0.1639 0.1524 0.3922;0.1742 0.2269 -0.0643 0.1639 -0.6555;-0.0310 0.1742 0.2269 -0.0643 0.1712;0.0954 -0.0310 0.1742 0.2269 0.706;0.2343 0.0954 -0.0310 0.1742 -0.0318;0.0882 0.2343 0.0954 -0.0310 0.2769;0.1328 0.0882 0.2343 0.0954 -0.0462;0.1009 0.1328 0.0882 0.2343 0.0971;0.1307 0.1009 0.1328 0.0882 0.8235;0.2552 0.1307 0.1009 0.1328 -0.6948;-0.0151 0.2552 0.1307 0.1009 0.3171];\r\n\r\ny = fillMatrix2(x,n);\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2016-03-06T08:47:45.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-03-06T08:44:13.000Z","updated_at":"2026-04-01T07:27:08.000Z","published_at":"2016-03-06T08:44:13.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\u003eInput is a column vector and n.\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 columns will be added to the left of the input column. The first value of the row is the mean of the previous row. The matrix should be filled 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[ input matrix = [1:8]'\\n n = 4;\\n output = \\n [\\n 0      0      0      0      1\\n 0.2    0      0      0      2\\n 0.44   0.2    0      0      3\\n 0.7280 0.44   0.2    0      4\\n 1.0736 0.7280 0.44   0.2    5\\n 1.4883 1.0736 0.7280 0.44   6\\n 1.9460 1.4883 1.0736 0.7280 7\\n 2.4472 1.9460 1.4883 1.0736 8\\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\u003eI request you to use the mean( ) function.\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":42858,"title":"Block average ignoring NaN values","description":"Given a matrix, calculate the block average of each disjoint sub-matrix while ignoring *NaN* values. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\r\n\r\n* Input: matrix *A* and the size of each sub-matrix *subsz*\r\n* Output: *B = blknanavg(A,subsz)*\r\n    \r\n\r\nExample:\r\n\r\n    A = [1 2 3 4 5 6 7 8 NaN];\r\n    subsz = [1  3];\r\n    B = [2  5  (7+8)/2];\r\n\r\nHint: this is related to \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42856-block-average Problem 42856. Block average\u003e.","description_html":"\u003cp\u003eGiven a matrix, calculate the block average of each disjoint sub-matrix while ignoring \u003cb\u003eNaN\u003c/b\u003e values. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\u003c/p\u003e\u003cul\u003e\u003cli\u003eInput: matrix \u003cb\u003eA\u003c/b\u003e and the size of each sub-matrix \u003cb\u003esubsz\u003c/b\u003e\u003c/li\u003e\u003cli\u003eOutput: \u003cb\u003eB = blknanavg(A,subsz)\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e    A = [1 2 3 4 5 6 7 8 NaN];\r\n    subsz = [1  3];\r\n    B = [2  5  (7+8)/2];\u003c/pre\u003e\u003cp\u003eHint: this is related to \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42856-block-average\"\u003eProblem 42856. Block average\u003c/a\u003e.\u003c/p\u003e","function_template":"function B = blknanavg(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [1 2 3 4 5 6 7 8 NaN];\r\nsubsz = [1  3];\r\nB = [2  5  (7+8)/2];\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = [1 2 3 4 NaN 6 7 NaN 9].';\r\nsubsz = [3,1];\r\nB = [2 5 8].';\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = [1       1     1       2     NaN       2\r\n     1     NaN     1     NaN       2     NaN\r\n     3       3     3     NaN     NaN     4\r\n     3       3     3     NaN       4     4];\r\nsubsz = [2   3];\r\nB = [1    2\r\n     3    4];\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = rand(100,300);\r\nA(randperm(numel(A),10)) = NaN;\r\nsubsz = size(A);\r\nB = mean(A(:),'omitnan');\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nsubsz = [4,6];\r\nB = 10*rand(10,20);\r\nA = repelem(B,subsz(1),subsz(2));\r\nA(randperm(numel(A),10)) = NaN;\r\nassert(norm(B-blknanavg(A,subsz)) \u003c 1e-10)","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":24,"created_at":"2016-05-21T19:53:06.000Z","updated_at":"2026-04-06T19:37:34.000Z","published_at":"2016-05-21T20:04:51.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 a matrix, calculate the block average of each disjoint sub-matrix while ignoring\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\u003eNaN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e values. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\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\u003eInput: 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and the size of each sub-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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esubsz\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\u003eOutput:\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\u003eB = blknanavg(A,subsz)\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\u003eExample:\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[    A = [1 2 3 4 5 6 7 8 NaN];\\n    subsz = [1  3];\\n    B = [2  5  (7+8)/2];]]\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\u003eHint: this is related to\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42856-block-average\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 42856. Block average\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42761,"title":"Fill the matrix - 1","description":"Input is a column vector and n. \r\n\r\nn columns will be added to the left of the input column. The first value of the row is the sum of the previous row. The matrix will be filled as follow;\r\n\r\n input matrix = [1:8]'\r\n n = 4;\r\n\r\n output = \r\n [\r\n 0\t0\t0\t0\t1\r\n 1\t0\t0\t0\t2\r\n 3\t1\t0\t0\t3\r\n 7\t3\t1\t0\t4\r\n 15\t7\t3\t1\t5\r\n 31\t15\t7\t3\t6\r\n 62\t31\t15\t7\t7\r\n 122\t62\t31\t15\t8\r\n ];\r\n\r\nI request you to use sum( ) function.","description_html":"\u003cp\u003eInput is a column vector and n.\u003c/p\u003e\u003cp\u003en columns will be added to the left of the input column. The first value of the row is the sum of the previous row. The matrix will be filled as follow;\u003c/p\u003e\u003cpre\u003e input matrix = [1:8]'\r\n n = 4;\u003c/pre\u003e\u003cpre\u003e output = \r\n [\r\n 0\t0\t0\t0\t1\r\n 1\t0\t0\t0\t2\r\n 3\t1\t0\t0\t3\r\n 7\t3\t1\t0\t4\r\n 15\t7\t3\t1\t5\r\n 31\t15\t7\t3\t6\r\n 62\t31\t15\t7\t7\r\n 122\t62\t31\t15\t8\r\n ];\u003c/pre\u003e\u003cp\u003eI request you to use sum( ) function.\u003c/p\u003e","function_template":"function y = fillMatrix(x,n)\r\n  x= [zeros(length(x),n) x];\r\nend","test_suite":"%%\r\nx = [1:8]';\r\nn = 4;\r\ny_correct = [\r\n0\t0\t0\t0\t1\r\n1\t0\t0\t0\t2\r\n3\t1\t0\t0\t3\r\n7\t3\t1\t0\t4\r\n15\t7\t3\t1\t5\r\n31\t15\t7\t3\t6\r\n62\t31\t15\t7\t7\r\n122\t62\t31\t15\t8\r\n];\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n%%\r\nx = [1.584;-1.015;8.4587;6.0147;9.0258;-10.4785];\r\nn = 4;\r\ny_correct = [\r\n0\t0\t0\t0\t1.584\r\n1.584\t0\t0\t0\t-1.015\r\n0.569\t1.584\t0\t0\t8.4587\r\n10.6117\t0.569\t1.584\t0\t6.0147\r\n18.7794\t10.6117\t0.569\t1.584\t9.0258\r\n40.5699\t18.7794\t10.6117\t0.569\t-10.4785\r\n];\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n\r\n%%\r\nx = [-2:10]';\r\nn = 3;\r\ny_correct = [\r\n0\t0\t0\t-2\r\n-2\t0\t0\t-1\r\n-3\t-2\t0\t0\r\n-5\t-3\t-2\t1\r\n-9\t-5\t-3\t2\r\n-15\t-9\t-5\t3\r\n-26\t-15\t-9\t4\r\n-46\t-26\t-15\t5\r\n-82\t-46\t-26\t6\r\n-148\t-82\t-46\t7\r\n-269\t-148\t-82\t8\r\n-491\t-269\t-148\t9\r\n-899\t-491\t-269\t10\r\n];\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n%%\r\nx = [-2:10]';\r\nn = 0;\r\ny_correct = x;\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));\r\n\r\n%%\r\nx = [0.814723686393179;0.905791937075619;0.126986816293506;0.913375856139019;0.632359246225410;0.0975404049994095;0.278498218867048;0.546881519204984;0.957506835434298;0.964888535199277];\r\nn = 8;\r\ny_correct = [0 0 0 0 0 0 0 0 0.814723686393179;0.814723686393179 0 0 0 0 0 0 0 0.905791937075619;1.72051562346880 0.814723686393179 0 0 0 0 0 0 0.126986816293506;2.66222612615548 1.72051562346880 0.814723686393179 0 0 0 0 0 0.913375856139019;6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0 0 0 0 0.632359246225410;11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0 0 0 0.0975404049994095;23.3465131075727 11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0 0 0.278498218867048;46.8739840290130 23.3465131075727 11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0 0.546881519204984;94.0163513583640 46.8739840290130 23.3465131075727 11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.814723686393179 0.957506835434298;188.443328032957 94.0163513583640 46.8739840290130 23.3465131075727 11.9406659743994 6.11084129215648 2.66222612615548 1.72051562346880 0.964888535199277];\r\n\r\ny = fillMatrix(x,n)\r\nassert(all(abs(y(:)-y_correct(:))\u003c1e-4));","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":64,"test_suite_updated_at":"2016-03-05T19:45:43.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-03-05T12:19:00.000Z","updated_at":"2026-04-01T07:22:20.000Z","published_at":"2016-03-05T12:19:00.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\u003eInput is a column vector and n.\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 columns will be added to the left of the input column. The first value of the row is the sum of the previous row. The matrix will be filled as follow;\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 matrix = [1:8]'\\n n = 4;\\n\\n output = \\n [\\n 0  0  0  0  1\\n 1  0  0  0  2\\n 3  1  0  0  3\\n 7  3  1  0  4\\n 15  7  3  1  5\\n 31  15  7  3  6\\n 62  31  15  7  7\\n 122  62  31  15  8\\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\u003eI request you to use sum( ) function.\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":43966,"title":"Matrix to 3-Column Matrix","description":"Consider a matrix *A* such as\r\n\r\n  A = [1 2 3 3 4 5 6;\r\n       2 3 4 5 6 7 8];\r\n\r\nCan you convert this matrix to a three-column matrix like this:\r\n\r\n\r\n  M=[1 2 3;\r\n     2 3 3;\r\n     3 3 4;\r\n     3 4 5;\r\n     4 5 6;\r\n     2 3 4;\r\n     3 4 5;\r\n     4 5 6;\r\n     5 6 7;\r\n     6 7 8]\r\n\r\n*hint:* please look at \r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43964-vector-to-3-column-matrix Problem 43964\u003e","description_html":"\u003cp\u003eConsider a matrix \u003cb\u003eA\u003c/b\u003e such as\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3 3 4 5 6;\r\n     2 3 4 5 6 7 8];\r\n\u003c/pre\u003e\u003cp\u003eCan you convert this matrix to a three-column matrix like this:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eM=[1 2 3;\r\n   2 3 3;\r\n   3 3 4;\r\n   3 4 5;\r\n   4 5 6;\r\n   2 3 4;\r\n   3 4 5;\r\n   4 5 6;\r\n   5 6 7;\r\n   6 7 8]\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003ehint:\u003c/b\u003e please look at  \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43964-vector-to-3-column-matrix\"\u003eProblem 43964\u003c/a\u003e\u003c/p\u003e","function_template":"function M = matrix2matrix(A)\r\n\r\nend","test_suite":"%%\r\nA = [1 2 3 3 4 5 6; 2 3 4 5 6 7 8];\r\nM=[1 2 3;2 3 3;3 3 4;3 4 5;4 5 6;2 3 4;3 4 5;4 5 6;5 6 7;6 7 8]\r\nassert(isequal(matrix2matrix(A),M))\r\n%%\r\nA=imread('http://www.mathworks.com/matlabcentral/profiles/3374772.jpg');\r\nA=rgb2gray(A);\r\nA=A(1:20, 1:20);\r\nM=[192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 192;193 192 193;192 193 194;193 194 195;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 192;193 192 193;192 193 194;193 194 194;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 192;193 192 192;192 192 193;192 193 194;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 191;193 191 192;191 192 193;192 193 194;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 191;193 191 192;191 192 193;192 193 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 191;193 191 191;191 191 192;191 192 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 190;193 190 191;190 191 192;191 192 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 191;192 191 191;191 191 191;191 191 192;191 192 192;192 192 193;192 193 193;193 193 193;193 193 190;193 190 191;190 191 192;191 192 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 192;193 192 192;192 192 192;192 192 192;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 192;193 192 192;192 192 192;192 192 192;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;193 193 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 193;192 193 193;193 193 193;193 193 193;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 192;192 192 193;192 193 193;193 193 193;193 193 193;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 192;191 192 192;192 192 192;192 192 192;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 191;191 191 190;191 190 190;190 190 190;190 190 190;190 189 189;189 189 188;189 188 188;188 188 189;188 189 189;189 189 190;189 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 189 189;189 189 188;189 188 188;188 188 189;188 189 189;189 189 190;189 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;189 189 188;189 188 188;188 188 188;188 188 188;188 188 189;188 189 189;189 189 190;189 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;190 190 190;189 189 188;189 188 187;188 187 187;187 187 188;187 188 189;188 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189;189 189 189];\r\nassert(isequal(matrix2matrix(A),M))\r\n%%\r\nA = [1 2 3];\r\nM=[1 2 3];\r\nassert(isequal(matrix2matrix(A),M))\r\n%%\r\nA = [1 2 3;2 3 4];\r\nM=A;\r\nassert(isequal(matrix2matrix(A),M))\r\n%%\r\nA = rand(1000000,3);\r\nM=A;\r\nassert(isequal(matrix2matrix(A),M))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":22216,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":55,"test_suite_updated_at":"2016-12-23T10:22:14.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-12-23T10:05:58.000Z","updated_at":"2026-04-01T07:39:52.000Z","published_at":"2016-12-23T10:20:46.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\u003eConsider a 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such as\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[A = [1 2 3 3 4 5 6;\\n     2 3 4 5 6 7 8];]]\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\u003eCan you convert this matrix to a three-column matrix like this:\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=[1 2 3;\\n   2 3 3;\\n   3 3 4;\\n   3 4 5;\\n   4 5 6;\\n   2 3 4;\\n   3 4 5;\\n   4 5 6;\\n   5 6 7;\\n   6 7 8]]]\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ehint:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e please look 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/43964-vector-to-3-column-matrix\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 43964\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42798,"title":"Moving Product (Easy)","description":"Given an input array A, write a function *movprod(A,k,dim)* to calculate the moving product over a sliding window of length *k* along the specified dimension *dim* of input array *A*. If dim is omitted, operate along the first non-singleton dimension of A. \r\n\r\nExample 1: \r\n\r\n    \u003e\u003e A = [1 2 3 4 5 6];\r\n    \u003e\u003e B = movprod(A,3)\r\n    B = \r\n       6   24   60   120\r\n\r\nExample 2: \r\n\r\n    \u003e\u003e A = [1     4     3    6    2\r\n            2     5     1    2    3\r\n            3     6     2    3    5];\r\n    \u003e\u003e B = movprod(A,3,2)\r\n    B = \r\n        12   72   36\r\n        10   10    6\r\n        36   36   30\r\n\r\n\r\nYou may assume that dim \u003c= 3, and the input array A is a non-empty array with size(A,dim) \u003e= k. \r\n\r\nRelated problems: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/429-function-on-a-moving-window Problem 429\u003e; \u003chttp://www.mathworks.com/matlabcentral/cody/problems/246-project-euler-problem-8-find-largest-product-in-a-large-string-of-numbers Problem 246\u003e\r\n\r\n*A kind note* (05/15/2017): This problem was created in 2016, one year before R2017a's introduction of the built-in movprod. To avoid function name clash, we've changed the user-defined function name into *moveprod* in the test-suite, which gives you the opportunity to solve the problem by directly calling the built-in movprod!\r\n\r\n","description_html":"\u003cp\u003eGiven an input array A, write a function \u003cb\u003emovprod(A,k,dim)\u003c/b\u003e to calculate the moving product over a sliding window of length \u003cb\u003ek\u003c/b\u003e along the specified dimension \u003cb\u003edim\u003c/b\u003e of input array \u003cb\u003eA\u003c/b\u003e. If dim is omitted, operate along the first non-singleton dimension of A.\u003c/p\u003e\u003cp\u003eExample 1:\u003c/p\u003e\u003cpre\u003e    \u0026gt;\u0026gt; A = [1 2 3 4 5 6];\r\n    \u0026gt;\u0026gt; B = movprod(A,3)\r\n    B = \r\n       6   24   60   120\u003c/pre\u003e\u003cp\u003eExample 2:\u003c/p\u003e\u003cpre\u003e    \u0026gt;\u0026gt; A = [1     4     3    6    2\r\n            2     5     1    2    3\r\n            3     6     2    3    5];\r\n    \u0026gt;\u0026gt; B = movprod(A,3,2)\r\n    B = \r\n        12   72   36\r\n        10   10    6\r\n        36   36   30\u003c/pre\u003e\u003cp\u003eYou may assume that dim \u0026lt;= 3, and the input array A is a non-empty array with size(A,dim) \u0026gt;= k.\u003c/p\u003e\u003cp\u003eRelated problems: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/429-function-on-a-moving-window\"\u003eProblem 429\u003c/a\u003e; \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/246-project-euler-problem-8-find-largest-product-in-a-large-string-of-numbers\"\u003eProblem 246\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eA kind note\u003c/b\u003e (05/15/2017): This problem was created in 2016, one year before R2017a's introduction of the built-in movprod. To avoid function name clash, we've changed the user-defined function name into \u003cb\u003emoveprod\u003c/b\u003e in the test-suite, which gives you the opportunity to solve the problem by directly calling the built-in movprod!\u003c/p\u003e","function_template":"function B = moveprod(A,k,dim)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [1 2 3 4 5 6];\r\nC = [6 24 60 120];\r\nassert(isequal(moveprod(A,3),C))\r\n\r\n%%\r\nA = [1 2 3 4 5 6].'/6;\r\nC = [2 6 12 20 30].'/6^2;\r\nB = moveprod(A,2);\r\nassert(max(abs(B-C)) \u003c= max(abs(C))*1e-12 \u0026\u0026 isequal(size(B),size(C)))\r\n\r\n%%\r\nA = [-1      4      3     6     -2\r\n      2      0      1     2     -3\r\n      3     -6     -2     3      5];\r\nC = [-2   0    3   12     6\r\n      6   0   -2    6   -15];\r\nassert(isequal(moveprod(A,2),C))\r\n\r\n%%\r\nA = [-1      4      3     6     2\r\n      2      0      1     2     3\r\n      3     -6     -2     3     5]/pi; \r\nC = [-12   72    36\r\n       0    0     6\r\n      36   36   -30]/pi^3;\r\nB = moveprod(A,3,2);\r\nassert(max(abs(B(:) - C(:))) \u003c= max(abs(C(:)))*1e-12 \u0026\u0026 isequal(size(B),size(C)))\r\n\r\n%% \r\nA = randi([-10,10],10,10,100);\r\nk = 5; dim = 3; \r\nB = moveprod(A,k,dim);\r\nszA = size(A);\r\nC = zeros(szA(1),szA(2),szA(3)-k+1);\r\nfor m = 1:szA(1)\r\n    for n = 1:szA(2)\r\n        C(m,n,:) = moveprod(squeeze(A(m,n,:)),k);\r\n    end\r\nend\r\nassert(isequal(B,C))\r\n\r\n%% \r\nA = 20*rand(10,10,100)-10;\r\nk = 4; dim = 3; \r\nB = moveprod(A,k,dim);\r\nszA = size(A);\r\nC = zeros(szA(1),szA(2),szA(3)-k+1);\r\nfor m = 1:szA(1)\r\n    for n = 1:szA(2)\r\n        C(m,n,:) = moveprod(squeeze(A(m,n,:)),k);\r\n    end\r\nend\r\nC = C + 100*eps(C);\r\nassert(max(abs(B(:) - C(:))) \u003c= max(abs(C(:)))*1e-12 \u0026\u0026 isequal(size(B),size(C)))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":"2017-05-16T00:02:52.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-04-07T20:56:32.000Z","updated_at":"2026-04-01T07:29:44.000Z","published_at":"2016-04-13T22:51:52.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 input array A, write a function\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\u003emovprod(A,k,dim)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to calculate the moving product over a sliding window of length\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\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e along the specified dimension\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\u003edim\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of input array\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\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. If dim is omitted, operate along the first non-singleton dimension of A.\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\u003eExample 1:\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[    \u003e\u003e A = [1 2 3 4 5 6];\\n    \u003e\u003e B = movprod(A,3)\\n    B = \\n       6   24   60   120]]\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\u003eExample 2:\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[    \u003e\u003e A = [1     4     3    6    2\\n            2     5     1    2    3\\n            3     6     2    3    5];\\n    \u003e\u003e B = movprod(A,3,2)\\n    B = \\n        12   72   36\\n        10   10    6\\n        36   36   30]]\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\u003eYou may assume that dim \u0026lt;= 3, and the input array A is a non-empty array with size(A,dim) \u0026gt;= k.\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\u003eRelated problems:\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/429-function-on-a-moving-window\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 429\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e;\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/246-project-euler-problem-8-find-largest-product-in-a-large-string-of-numbers\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 246\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA kind note\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (05/15/2017): This problem was created in 2016, one year before R2017a's introduction of the built-in movprod. To avoid function name clash, we've changed the user-defined function name into\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\u003emoveprod\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in the test-suite, which gives you the opportunity to solve the problem by directly calling the built-in movprod!\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":42635,"title":"Maximum of each diagonal","description":"The well-known \u003chttp://www.mathworks.com/help/matlab/ref/max.html max\u003e function can operate along either the rows or the columns of a matrix by using\r\n\r\n  [Y,I] = max(X,[],1) or [Y,I] = max(X,[],2)\r\n\r\nbut it cannot operate along a diagonal dimension. For this problem, create a function that returns the largest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the matrix).\r\n\r\n*Example*\r\n\r\nIf \r\n\r\n  X = magic(3) = [8 1 6\r\n                  3 5 7\r\n                  4 9 2]\r\n\r\nthen\r\n\r\n  Y = maxdiag(X) = [4 9 8 7 6]\r\n\r\nSee also \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42634-minimum-of-each-diagonal mindiag\u003e.","description_html":"\u003cp\u003eThe well-known \u003ca href = \"http://www.mathworks.com/help/matlab/ref/max.html\"\u003emax\u003c/a\u003e function can operate along either the rows or the columns of a matrix by using\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[Y,I] = max(X,[],1) or [Y,I] = max(X,[],2)\r\n\u003c/pre\u003e\u003cp\u003ebut it cannot operate along a diagonal dimension. For this problem, create a function that returns the largest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the matrix).\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eX = magic(3) = [8 1 6\r\n                3 5 7\r\n                4 9 2]\r\n\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eY = maxdiag(X) = [4 9 8 7 6]\r\n\u003c/pre\u003e\u003cp\u003eSee also \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42634-minimum-of-each-diagonal\"\u003emindiag\u003c/a\u003e.\u003c/p\u003e","function_template":"function y = maxdiag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isempty(maxdiag([])))\r\n\r\n%%\r\nx = randi(100);\r\nassert(isequal(maxdiag(x),x))\r\n\r\n%%\r\nx = randi(100,100,1);\r\nassert(isequal(maxdiag(x),x(end:-1:1)'))\r\n\r\n%%\r\nx = randi(100,1,100);\r\nassert(isequal(maxdiag(x),x))\r\n\r\n%%\r\nx = eye(2);\r\nassert(isequal(maxdiag(x),[0 1 0]))\r\n\r\n%%\r\nx = magic(3);\r\nassert(isequal(maxdiag(x),[4 9 8 7 6]))\r\n\r\n%%\r\nx = flipud(hankel(1:1000));\r\nassert(isequal(maxdiag(x),[1:1000,zeros(1,1000-1)]))\r\n\r\n%%\r\nx = toeplitz(1:1000);\r\nassert(isequal(maxdiag(x),[1000:-1:1,2:1000]))\r\n\r\n%%\r\nN = randi(1000);\r\nx = fliplr(toeplitz(1:N));\r\nassert(isequal(maxdiag(x),[1:N,N-1:-1:1]))\r\n\r\n%%\r\nx = magic(10);\r\nx = x(:,1:3);\r\nassert(isequal(maxdiag(x),[11 18 100 94 17 86 93 87 98 92 99 1]))\r\n\r\n%%\r\nx = hankel(-4:0,0:-2:-16);\r\nassert(isequal(maxdiag(x),[0 -1 0 -1 0 -1 0 -1 0 -2 -4 -6 -8]))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-23T23:12:25.000Z","updated_at":"2026-04-01T07:14:21.000Z","published_at":"2015-09-23T23:12:25.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\u003eThe well-known\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=\\\"http://www.mathworks.com/help/matlab/ref/max.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emax\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e function can operate along either the rows or the columns of a matrix by using\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,I] = max(X,[],1) or [Y,I] = max(X,[],2)]]\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\u003ebut it cannot operate along a diagonal dimension. For this problem, create a function that returns the largest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\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\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 = magic(3) = [8 1 6\\n                3 5 7\\n                4 9 2]]]\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\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 = maxdiag(X) = [4 9 8 7 6]]]\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 also\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42634-minimum-of-each-diagonal\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emindiag\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42856,"title":" Block average","description":"Given a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension. \r\n\r\n* Input: matrix *A* and the size of each sub-matrix *subsz*\r\n* Output: *B = blkavg(A,subsz)*\r\n\r\nExample: \r\n\r\n    A = [2  0  1  3  5  7];\r\n    subsz = [1  2];\r\n    B = [1  2  6];\r\n\r\n\r\nHint: this is related to \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42854-crunch-that-matrix Problem 42854. Crunch that matrix!\u003e.\r\n\r\nNext problem: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42858-block-average-ignoring-nan-values \r\nProblem 42858. Block average ignoring NaN values\u003e","description_html":"\u003cp\u003eGiven a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\u003c/p\u003e\u003cul\u003e\u003cli\u003eInput: matrix \u003cb\u003eA\u003c/b\u003e and the size of each sub-matrix \u003cb\u003esubsz\u003c/b\u003e\u003c/li\u003e\u003cli\u003eOutput: \u003cb\u003eB = blkavg(A,subsz)\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e    A = [2  0  1  3  5  7];\r\n    subsz = [1  2];\r\n    B = [1  2  6];\u003c/pre\u003e\u003cp\u003eHint: this is related to \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42854-crunch-that-matrix\"\u003eProblem 42854. Crunch that matrix!\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eNext problem: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42858-block-average-ignoring-nan-values\"\u003eProblem 42858. Block average ignoring NaN values\u003c/a\u003e\u003c/p\u003e","function_template":"function B = blkavg(A,subsz)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [2  0  1  3  5  7];\r\nsubsz = [1 2];\r\nB = [1 2 6];\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = [1 2 3 4 5 6 7 8 9].';\r\nsubsz = [3,1];\r\nB = [2 5 8].';\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = [1     1     1     2     2     2\r\n     1     1     1     2     2     2\r\n     3     3     3     4     4     4\r\n     3     3     3     4     4     4];\r\nsubsz = [2   3];\r\nB = [1    2\r\n     3    4];\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nA = rand(100,300);\r\nsubsz = size(A);\r\nB = mean(A(:));\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)\r\n\r\n%%\r\nsubsz = [4,6];\r\nB = 10*rand(10,20);\r\nA = repelem(B,subsz(1),subsz(2));\r\nassert(norm(B-blkavg(A,subsz)) \u003c 1e-10)","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":47,"test_suite_updated_at":"2016-05-21T16:50:42.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2016-05-21T02:56:16.000Z","updated_at":"2026-04-06T19:34:11.000Z","published_at":"2016-05-21T15:43:54.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 a matrix, calculate the block average of each disjoint sub-matrix of the same size. Assume that the size of the matrix along each dimension is an integer multiple of the size of the sub-matrix along the same dimension.\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\u003eInput: 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and the size of each sub-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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esubsz\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\u003eOutput:\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\u003eB = blkavg(A,subsz)\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\u003eExample:\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[    A = [2  0  1  3  5  7];\\n    subsz = [1  2];\\n    B = [1  2  6];]]\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\u003eHint: this is related to\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42854-crunch-that-matrix\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 42854. Crunch that matrix!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\u003eNext problem:\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42858-block-average-ignoring-nan-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 42858. Block average ignoring NaN values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42634,"title":"Minimum of each diagonal","description":"The well-known \u003chttp://www.mathworks.com/help/matlab/ref/min.html min\u003e function can operate along either the rows or the columns of a matrix by using\r\n\r\n  [Y,I] = min(X,[],1) or [Y,I] = min(X,[],2)\r\n\r\nbut it cannot operate along a diagonal dimension. For this problem, create a function that returns the smallest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the matrix).\r\n\r\n*Example*\r\n\r\nIf \r\n\r\n  X = magic(3) = [8 1 6\r\n                  3 5 7\r\n                  4 9 2]\r\n\r\nthen\r\n\r\n  Y = mindiag(X) = [4 3 2 1 6]\r\n\r\nSee also \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42635-maximum-of-each-diagonal maxdiag\u003e.","description_html":"\u003cp\u003eThe well-known \u003ca href = \"http://www.mathworks.com/help/matlab/ref/min.html\"\u003emin\u003c/a\u003e function can operate along either the rows or the columns of a matrix by using\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[Y,I] = min(X,[],1) or [Y,I] = min(X,[],2)\r\n\u003c/pre\u003e\u003cp\u003ebut it cannot operate along a diagonal dimension. For this problem, create a function that returns the smallest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the matrix).\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eX = magic(3) = [8 1 6\r\n                3 5 7\r\n                4 9 2]\r\n\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eY = mindiag(X) = [4 3 2 1 6]\r\n\u003c/pre\u003e\u003cp\u003eSee also \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42635-maximum-of-each-diagonal\"\u003emaxdiag\u003c/a\u003e.\u003c/p\u003e","function_template":"function y = mindiag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isempty(mindiag([])))\r\n\r\n%%\r\nx = randi(100);\r\nassert(isequal(mindiag(x),x))\r\n\r\n%%\r\nx = randi(100,100,1);\r\nassert(isequal(mindiag(x),x(end:-1:1)'))\r\n\r\n%%\r\nx = randi(100,1,100);\r\nassert(isequal(mindiag(x),x))\r\n\r\n%%\r\nx = eye(2);\r\nassert(isequal(mindiag(x),[0 1 0]))\r\n\r\n%%\r\nx = magic(3);\r\nassert(isequal(mindiag(x),[4 3 2 1 6]))\r\n\r\n%%\r\nx = flipud(hankel(1:1000));\r\nassert(isequal(mindiag(x),[1:1000,zeros(1,1000-1)]))\r\n\r\n%%\r\nx = toeplitz(1:1000);\r\nassert(isequal(mindiag(x),[1000:-1:1,2:1000]))\r\n\r\n%%\r\nN = randi(1000);\r\nx = fliplr(toeplitz(1:N));\r\ny = ones(1,2*N-1);\r\ny(2:2:end) = 2;\r\nassert(isequal(mindiag(x),y))\r\n\r\n%%\r\nx = magic(10);\r\nx = x(:,1:3);\r\nassert(isequal(mindiag(x),[11 10 12 6 5 24 76 4 19 80 7 1]))\r\n\r\n%%\r\nx = hankel(-4:0,0:-2:-16);\r\nassert(isequal(mindiag(x),[0 -2 -4 -6 -8 -10 -12 -14 -16 -14 -12 -10 -8]))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":"2015-09-23T23:03:11.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-23T23:00:02.000Z","updated_at":"2026-04-01T07:12:19.000Z","published_at":"2015-09-23T23:00:02.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\u003eThe well-known\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=\\\"http://www.mathworks.com/help/matlab/ref/min.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emin\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e function can operate along either the rows or the columns of a matrix by using\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,I] = min(X,[],1) or [Y,I] = min(X,[],2)]]\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\u003ebut it cannot operate along a diagonal dimension. For this problem, create a function that returns the smallest component along each diagonal of a matrix (starting with the one-element diagonal in the bottom left corner of the 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\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\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 = magic(3) = [8 1 6\\n                3 5 7\\n                4 9 2]]]\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\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 = mindiag(X) = [4 3 2 1 6]]]\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 also\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42635-maximum-of-each-diagonal\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emaxdiag\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":2700,"title":"Simulate one complete step in the Biham–Middleton–Levine traffic model","description":"The \u003chttp://en.wikipedia.org/wiki/Biham%E2%80%93Middleton%E2%80%93Levine_traffic_model Biham–Middleton–Levine traffic model\u003e is a simple cellular automata model loosely mimicking traffic flow. In an m-by-n domain, we see white empty space (or 0 in our matrix representation), red cars (1 in the matrix), and blue cars (2 in the matrix).\r\n\r\nAssume the space is toroidal. That is to say, the right side connects with the left, and the top connects to the bottom. So a red car that moves off the far right of the matrix re-appears on the far left.\r\n\r\nHere is a 4-by-4 version with three red cars and two blue cars.\r\n\r\n     0     0     0     2\r\n     1     1     0     0\r\n     0     0     2     0\r\n     0     0     0     1\r\n\r\nRed cars always move to the right if they are unblocked. A red car can move either into an empty space or a space being vacated by a moving red car.\r\n\r\nAfter we move the red cars (1s) we will have this matrix.\r\n\r\n     0     0     0     2\r\n     0     1     1     0\r\n     0     0     2     0\r\n     1     0     0     0\r\n\r\nWe're only halfway through the process. After we move the blue cars (2s) we end up here.\r\n\r\n     0     0     0     0\r\n     0     1     1     2\r\n     0     0     0     0\r\n     1     0     2     0\r\n\r\nThis last value of the matrix would be the return value of your function. Assume that red cars always move before blue cars.\r\n\r\nFor some visualizations of Biham–Middleton–Levine traffic, see this very nice \u003chttp://www.jasondavies.com/bml/#0.61/769/512 simulation site\u003e.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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=\"block-size: 859px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 332px 429.5px; transform-origin: 332px 429.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 31.5px; text-align: left; transform-origin: 309px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://en.wikipedia.org/wiki/Biham%E2%80%93Middleton%E2%80%93Levine_traffic_model\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eBiham–Middleton–Levine traffic model\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e is a simple cellular automata model loosely mimicking traffic flow. In an m-by-n domain, we see white empty space (or 0 in our matrix representation), red cars (1 in the matrix), and blue cars (2 in the matrix).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 31.5px; text-align: left; transform-origin: 309px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAssume the space is toroidal. That is to say, the right side connects with the left, and the top connects to the bottom. So a red car that moves off the far right of the matrix re-appears on the far left.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHere is a 4-by-4 version with three red cars and two blue cars.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 40px; transform-origin: 329px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1     1     0     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     2     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eRed cars always move to the right if they are unblocked. A red car can move either into an empty space or a space being vacated by a moving red car.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAfter we move the red cars (1s) we will have this matrix.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 40px; transform-origin: 329px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     1     1     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     2     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1     0     0     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eWe're only halfway through the process. After we move the blue cars (2s) we end up here.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 80px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 329px 40px; transform-origin: 329px 40px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     1     1     2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     0     0     0     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 329px 10px; transform-origin: 329px 10px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1     0     2     0\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 309px 21px; text-align: left; transform-origin: 309px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis last value of the matrix would be the return value of your function. Assume that red cars always move before blue cars.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 220px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 110px; text-align: left; transform-origin: 309px 110px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdEAAADWCAYAAACOsbiXAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AkBDysfBIlBgQAAAAd0RVh0QXV0aG9yAKmuzEgAA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dHRuUv0IKqjo6Ojo3OX6EFUR0dHR0fnLtGDqI6Ojo6Ozl2iB1EdHR0dHZ275P8DngxITpAUs2UAAAAASUVORK5CYII=\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 309px 10.5px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor some visualizations of Biham–Middleton–Levine traffic, see this very nice \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"http://www.jasondavies.com/bml/#0.61/769/512\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003esimulation site\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function a_out = traffic_step(a_in)\r\n  a_out = a_in;\r\nend","test_suite":"%%\r\na_in = ...\r\n  [0 0 0 2\r\n   1 1 0 0\r\n   0 0 2 0\r\n   0 0 0 1];\r\na_out_correct = ...\r\n  [0 0 0 0\r\n   0 1 1 2\r\n   0 0 0 0\r\n   1 0 2 0];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in = ...\r\n  [0 0 2\r\n   2 0 0];\r\na_out_correct = ...\r\n  [2 0 0\r\n   0 0 2];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in = ...\r\n  [1 0 2\r\n   2 0 0];\r\na_out_correct = ...\r\n  [2 1 0\r\n   0 0 2];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in = ...\r\n  [0 0 2\r\n   1 1 1\r\n   2 0 0];\r\na_out_correct = ...\r\n  [2 0 2\r\n   1 1 1\r\n   0 0 0];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in = ...\r\n    [0     2     2     2     0     0\r\n     1     1     0     2     0     0\r\n     0     0     0     0     2     0\r\n     1     1     0     1     1     2\r\n     0     0     1     2     0     0\r\n     0     0     0     2     0     1];\r\na_out_correct = ...\r\n    [0     2     2     2     0     0\r\n     0     1     1     2     0     0\r\n     0     0     0     2     2     0\r\n     0     1     1     1     1     0\r\n     0     0     1     0     0     2\r\n     1     0     0     2     0     0];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in =  ...\r\n    [0 1 1 1\r\n     0 0 0 0];\r\na_out_correct = ...\r\n    [1 0 1 1\r\n     0 0 0 0];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n\r\n%%\r\na_in =  ...\r\n    [0\r\n     2\r\n     2];\r\na_out_correct = ...\r\n    [2\r\n     0\r\n     2];\r\nassert(isequal(traffic_step(a_in),a_out_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":36,"test_suite_updated_at":"2014-12-04T15:56:53.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2014-12-01T23:45:31.000Z","updated_at":"2026-03-29T06:52:52.000Z","published_at":"2014-12-02T19:28:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"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\u003eThe\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=\\\"http://en.wikipedia.org/wiki/Biham%E2%80%93Middleton%E2%80%93Levine_traffic_model\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eBiham–Middleton–Levine traffic model\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is a simple cellular automata model loosely mimicking traffic flow. In an m-by-n domain, we see white empty space (or 0 in our matrix representation), red cars (1 in the matrix), and blue cars (2 in the 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAssume the space is toroidal. That is to say, the right side connects with the left, and the top connects to the bottom. So a red car that moves off the far right of the matrix re-appears on the far left.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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\u003eHere is a 4-by-4 version with three red cars and two blue cars.\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[     0     0     0     2\\n     1     1     0     0\\n     0     0     2     0\\n     0     0     0     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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRed cars always move to the right if they are unblocked. A red car can move either into an empty space or a space being vacated by a moving red car.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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\u003eAfter we move the red cars (1s) we will have this 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[     0     0     0     2\\n     0     1     1     0\\n     0     0     2     0\\n     1     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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe're only halfway through the process. After we move the blue cars (2s) we end up here.\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[     0     0     0     0\\n     0     1     1     2\\n     0     0     0     0\\n     1     0     2     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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis last value of the matrix would be the return value of your function. Assume that red cars always move before blue cars.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\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\u003eFor some visualizations of Biham–Middleton–Levine traffic, see this very nice \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.jasondavies.com/bml/#0.61/769/512\\\"\u003e\u003cw:r\u003e\u003cw:t\u003esimulation site\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdEAAADWCAYAAACOsbiXAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5AkBDysfBIlBgQAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAgAElEQVR4nOzdeZwU9Z34/1dVdXX1OT0nzAEzDAww3AMioFEkChK8UIMHbrLumqhZs2u+bpLdx2OTb3bz2P0+dh+PmE2yyS+JGl0TRRAV44X3hSIqRkC55BzO4Zh7+u6uqt8fPdXOwCA4DHO+n49HO9jT01Uz9e73u+pzlWLbto0QQgghvjS1r3dACCGEGKikiAohhBDdJEVUCCGE6CYpokIIIUQ3SREVQgghukmKqBBCCNFNUkSFEEKIbpIiKoQQQnSTFFEhhBCim6SICiGEEN0kRVQIIYToJte5fHPbtlEUBYB4PM7u3bvZsGED9fX1RCIREokEHo+HQCDAsGHDOO+88ygvL8cwjJN+XogvIxaLsXPnTjZu3EhjY2M23rxeL36/n+LiYs477zxGjhyJ2+0GJN7E2XPy3Mcff0xDQ8Mp81xFRYXE3SBxTouooig0NTXx+uuv8+abb1JbW0skEsE0TSzLwrIsVFVFVVU0TSMnJ4fRo0czf/585s2bRyAQOJe7Jwah+vp6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ET7ehZy85nDAjC/VuaVxAEjEYjmqYAlq+w3d3y18S1UT44dBhJVigWJdY9+BB/9u0ngDLtHV082LIS891WPfoTY/majQiCA8r3R5WhWyEIhq/wt9vb7pTR4QEOf/gxiqpRlGQ2bXmEJ7Y9BuUy3ctX4e9Yo8td6ejcBboU2m2QZYlcNk9dfQMmk+E2Nhcm093deBRFIZ1OoygKZrMZt8dzU2avzp8OklQknxcr/mYU7th2pyiyTCqdRlVVzGYLHo/7dx+ko6PzO9GDqI6Ojo6Ozl2irxfq6Ojo6OjcJXoQ1dHR0dHRuUv0IKqjo6Ojo3OX6EFUR0dHR0fnLtGDqI6Ojo6Ozl2iB1EdHR0dHZ275P8DngxITpAUs2UAAAAASUVORK5CYII=\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":42631,"title":"Cumulative minimum of an array","description":"Find the cumulative minimum of an array without using the built-in function \u003chttp://www.mathworks.com/help/matlab/ref/cummin.html cummin\u003e (and a few others). Your function should act identically to cummin, allowing the same inputs.\r\n\r\n*Examples*\r\n\r\n  If X = [0 4 3\r\n          6 5 2]\r\n\r\n  cumin(X,1) is [0 4 3  and cumin(X,2) is [0 0 0\r\n                 0 4 2]                    6 5 2]\r\n \r\n  cumin(X,1,'reverse') is [0 4 2  and cumin(X,2,'reverse') is [0 3 3\r\n                           6 5 2]                              2 2 2]\r\n\r\n  Also,\r\n  cumin([8 9 1 10 6 1 3 6 10 10]) returns [8 8 1 1 1 1 1 1 1 1]\r\n\r\n  cumin([8 9 1 10 6 1 3 6 10 10]') returns [8 8 1 1 1 1 1 1 1 1]'\r\n\r\nSee also \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42633-cumulative-maximum-of-an-array cumax\u003e.","description_html":"\u003cp\u003eFind the cumulative minimum of an array without using the built-in function \u003ca href = \"http://www.mathworks.com/help/matlab/ref/cummin.html\"\u003ecummin\u003c/a\u003e (and a few others). Your function should act identically to cummin, allowing the same inputs.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eIf X = [0 4 3\r\n        6 5 2]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ecumin(X,1) is [0 4 3  and cumin(X,2) is [0 0 0\r\n               0 4 2]                    6 5 2]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ecumin(X,1,'reverse') is [0 4 2  and cumin(X,2,'reverse') is [0 3 3\r\n                         6 5 2]                              2 2 2]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eAlso,\r\ncumin([8 9 1 10 6 1 3 6 10 10]) returns [8 8 1 1 1 1 1 1 1 1]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ecumin([8 9 1 10 6 1 3 6 10 10]') returns [8 8 1 1 1 1 1 1 1 1]'\r\n\u003c/pre\u003e\u003cp\u003eSee also \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42633-cumulative-maximum-of-an-array\"\u003ecumax\u003c/a\u003e.\u003c/p\u003e","function_template":"function y = cumin(x,varargin)\r\n  y = [];\r\nend","test_suite":"%%\r\nfiletext = fileread('cumin.m');\r\nassert(isempty(strfind(filetext,'cummin')))\r\nassert(isempty(strfind(filetext,'cummax')))\r\nassert(isempty(strfind(filetext,'feval')))\r\n\r\n%%\r\nx = randi(100);\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))\r\n\r\n%%\r\nx = randi(100,randi([2 100]),1);\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))\r\n\r\n%%\r\nx = randi(100,1,randi([2 100]));\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))\r\n\r\n%%\r\nx = magic(10);\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))\r\n\r\n%%\r\nx = [];\r\nassert(isequal(cumin(x),cummin(x)))\r\nassert(isequal(cumin(x,1),cummin(x,1)))\r\nassert(isequal(cumin(x,2),cummin(x,2)))\r\nassert(isequal(cumin(x,1,'reverse'),cummin(x,1,'reverse')))\r\nassert(isequal(cumin(x,2,'reverse'),cummin(x,2,'reverse')))\r\nassert(isequal(cumin(x,'reverse'),cummin(x,'reverse')))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":42,"test_suite_updated_at":"2015-09-24T04:46:57.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-22T21:12:22.000Z","updated_at":"2026-04-01T07:07:43.000Z","published_at":"2015-09-23T19:24:39.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\u003eFind the cumulative minimum of an array without using the built-in function\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=\\\"http://www.mathworks.com/help/matlab/ref/cummin.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecummin\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (and a few others). Your function should act identically to cummin, allowing the same inputs.\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\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[If X = [0 4 3\\n        6 5 2]\\n\\ncumin(X,1) is [0 4 3  and cumin(X,2) is [0 0 0\\n               0 4 2]                    6 5 2]\\n\\ncumin(X,1,'reverse') is [0 4 2  and cumin(X,2,'reverse') is [0 3 3\\n                         6 5 2]                              2 2 2]\\n\\nAlso,\\ncumin([8 9 1 10 6 1 3 6 10 10]) returns [8 8 1 1 1 1 1 1 1 1]\\n\\ncumin([8 9 1 10 6 1 3 6 10 10]') returns [8 8 1 1 1 1 1 1 1 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\u003eSee also\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/42633-cumulative-maximum-of-an-array\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecumax\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42633,"title":"Cumulative maximum of an array","description":"Find the cumulative maximum of an array without using the built-in function cummax (and a few others). Your function should act identically to cummax, allowing the same inputs.\r\nExamples\r\nIf X = [0 4 3\r\n        6 5 2]\r\n\r\ncumax(X,1) is [0 4 3  and cumax(X,2) is [0 4 4\r\n               6 5 3]                    6 6 6]\r\n\r\ncumax(X,1,'reverse') is [6 5 3  and cumax(X,2,'reverse') is [4 4 3\r\n                         6 5 2]                              6 5 2]\r\n\r\nAlso,\r\ncumax([8 9 1 10 6 1 3 6 10 10]) returns [8 9 9 10 10 10 10 10 10 10]\r\n\r\ncumax([8 9 1 10 6 1 3 6 10 10]') returns [8 9 9 10 10 10 10 10 10 10]'\r\nSee also cumin.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 378.633px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 189.317px; transform-origin: 407px 189.317px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 234px 8px; transform-origin: 234px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFind the cumulative maximum of an array without using the built-in function\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ecummax\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 107px 8px; transform-origin: 107px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e (and a few others). Your function should act identically to cummax, allowing the same inputs.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 33.5px 8px; transform-origin: 33.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExamples\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 265.633px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 132.817px; transform-origin: 404px 132.817px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 52px 8.5px; tab-size: 4; transform-origin: 52px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 12px 8.5px; transform-origin: 12px 8.5px; \"\u003eIf \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 40px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 40px 8.5px; \"\u003eX = [0 4 3\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        6 5 2]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 184px 8.5px; tab-size: 4; transform-origin: 184px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 56px 8.5px; transform-origin: 56px 8.5px; \"\u003ecumax(X,1) is \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 128px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 128px 8.5px; \"\u003e[0 4 3  and cumax(X,2) is [0 4 4\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 188px 8.5px; tab-size: 4; transform-origin: 188px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e               6 5 3]                    6 6 6]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 264px 8.5px; tab-size: 4; transform-origin: 264px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003ecumax(X,1,\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 36px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 36px 8.5px; \"\u003e'reverse'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 20px 8.5px; transform-origin: 20px 8.5px; \"\u003e) is \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 168px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 168px 8.5px; \"\u003e[6 5 3  and cumax(X,2,'reverse') is [4 4 3\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 268px 8.5px; tab-size: 4; transform-origin: 268px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e                         6 5 2]                              6 5 2]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 20px 8.5px; tab-size: 4; transform-origin: 20px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eAlso,\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 272px 8.5px; tab-size: 4; transform-origin: 272px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 160px 8.5px; transform-origin: 160px 8.5px; \"\u003ecumax([8 9 1 10 6 1 3 6 10 10]) returns \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 112px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 112px 8.5px; \"\u003e[8 9 9 10 10 10 10 10 10 10]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; tab-size: 4; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 280px 8.5px; tab-size: 4; transform-origin: 280px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003ecumax([8 9 1 10 6 1 3 6 10 10]') returns \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(196, 0, 0); border-block-start-color: rgb(196, 0, 0); border-bottom-color: rgb(196, 0, 0); border-inline-end-color: rgb(196, 0, 0); border-inline-start-color: rgb(196, 0, 0); border-left-color: rgb(196, 0, 0); border-right-color: rgb(196, 0, 0); border-top-color: rgb(196, 0, 0); caret-color: rgb(196, 0, 0); color: rgb(196, 0, 0); column-rule-color: rgb(196, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(196, 0, 0); perspective-origin: 116px 8.5px; text-decoration-color: rgb(196, 0, 0); text-emphasis-color: rgb(196, 0, 0); transform-origin: 116px 8.5px; \"\u003e[8 9 9 10 10 10 10 10 10 10]'\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 27.5px 8px; transform-origin: 27.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSee also\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003ecumin\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = cumaX(x,varargin)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('cumaX.m');\r\nassert(isempty(strfind(filetext,'max')))\r\nassert(isempty(strfind(filetext,'cummin')))\r\nassert(isempty(strfind(filetext,'cummax')))\r\nassert(isempty(strfind(filetext,'feval')))\r\n\r\n%%\r\nx = randi(100);\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n\r\n%%\r\nx = randi(100,randi([2 100]),1);\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n\r\n%%\r\nx = randi(100,1,randi([2 100]));\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n\r\n%%\r\nx = magic(10);\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n\r\n%%\r\nx = [];\r\nassert(isequal(cumaX(x),cummax(x)))\r\nassert(isequal(cumaX(x,1),cummax(x,1)))\r\nassert(isequal(cumaX(x,2),cummax(x,2)))\r\nassert(isequal(cumaX(x,1,'reverse'),cummax(x,1,'reverse')))\r\nassert(isequal(cumaX(x,2,'reverse'),cummax(x,2,'reverse')))\r\nassert(isequal(cumaX(x,'reverse'),cummax(x,'reverse')))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":5,"created_by":4793,"edited_by":223089,"edited_at":"2022-10-09T10:09:17.000Z","deleted_by":null,"deleted_at":null,"solvers_count":42,"test_suite_updated_at":"2022-10-09T10:09:17.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-09-23T19:36:49.000Z","updated_at":"2026-03-29T06:57:19.000Z","published_at":"2015-09-23T19:38:39.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"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\u003eFind the cumulative maximum of an array without using the built-in function\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecummax\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (and a few others). Your function should act identically to cummax, allowing the same inputs.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\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[If X = [0 4 3\\n        6 5 2]\\n\\ncumax(X,1) is [0 4 3  and cumax(X,2) is [0 4 4\\n               6 5 3]                    6 6 6]\\n\\ncumax(X,1,'reverse') is [6 5 3  and cumax(X,2,'reverse') is [4 4 3\\n                         6 5 2]                              6 5 2]\\n\\nAlso,\\ncumax([8 9 1 10 6 1 3 6 10 10]) returns [8 9 9 10 10 10 10 10 10 10]\\n\\ncumax([8 9 1 10 6 1 3 6 10 10]') returns [8 9 9 10 10 10 10 10 10 10]']]\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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee also\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecumin\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44080,"title":"Construct a \"diagAdiag\" matrix","description":"Construct a matrix whose elements begin from 1 and end at n^2 with the order of arrangement as shown below:\r\n\r\nFor:\r\n\r\n  n = 4\r\n\r\noutput\r\n\r\n  M = \r\n[1   2   6   7;\r\n 3   5   8   13;\r\n 4   9   12  14;\r\n 10  11  15  16]\r\n\r\nNote the elements increase and decrease along alternating diagonals with the last element being always n^2.\r\n","description_html":"\u003cp\u003eConstruct a matrix whose elements begin from 1 and end at n^2 with the order of arrangement as shown below:\u003c/p\u003e\u003cp\u003eFor:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003en = 4\r\n\u003c/pre\u003e\u003cp\u003eoutput\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eM = \r\n[1   2   6   7;\r\n3   5   8   13;\r\n4   9   12  14;\r\n10  11  15  16]\r\n\u003c/pre\u003e\u003cp\u003eNote the elements increase and decrease along alternating diagonals with the last element being always n^2.\u003c/p\u003e","function_template":"function y = diagAdiag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 3;\r\ny_correct = [1 2 6; 3 5 7;4 8 9];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n\r\n%%\r\nx = 4;\r\ny_correct = [1   2   6   7; 3   5   8   13;4   9   12  14;10  11  15  16];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = [1 2 6 7 15;3 5 8 14 16;4 9 13 17 22;10 12 18 21 23;11 19 20 24 25];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n\r\n%%\r\nx = 6;\r\ny_correct = [ 1  2  6  7 15 16;\r\n              3  5  8 14 17 26;\r\n              4  9 13 18 25 27;\r\n             10 12 19 24 28 33;\r\n             11 20 23 29 32 34;\r\n             21 22 30 31 35 36];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n\r\n%%\r\nx = 7;\r\ny_correct = [ 1  2  6  7 15 16 28;\r\n              3  5  8 14 17 27 29;\r\n              4  9 13 18 26 30 39;\r\n             10 12 19 25 31 38 40;\r\n             11 20 24 32 37 41 46;\r\n             21 23 33 36 42 45 47;\r\n             22 34 35 43 44 48 49];\r\nassert(isequal(diagAdiag(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":98103,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":"2017-04-19T17:09:18.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2017-03-04T19:12:05.000Z","updated_at":"2026-04-02T22:13:25.000Z","published_at":"2017-03-04T19:15:05.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\u003eConstruct a matrix whose elements begin from 1 and end at n^2 with the order of arrangement as shown below:\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:\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 = 4]]\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\u003eoutput\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[1   2   6   7;\\n3   5   8   13;\\n4   9   12  14;\\n10  11  15  16]]]\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\u003eNote the elements increase and decrease along alternating diagonals with the last element being always n^2.\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":42504,"title":"Data Regularization","description":"Provided is an m-by-n integer data matrix A whose elements are drawn arbitrarily from a set *S* = [1,2,3,...,S] for any large integer number S \u003e 1. The \"arbitrary\" manner of drawing integer numbers implies that each column of A might contain only a subset of integer numbers from *S*. Our objective is to regularize the data in A subject to the following rules: \r\n\r\nFor each column in A, \r\n\r\n* The smallest number or numbers (if there are more than one such number) are mapped to 1; \r\n* The 2nd-smallest number or numbers (if there are more than one such number) are mapped to 2;\r\n* The _k_ th-smallest number or numbers (if there are more than one such number) are mapped to _k_ .\r\n\r\nFor example, *S* = [1:8] with S = 8. Suppose the input data matrix A is \r\n \r\n  A = [2  6\r\n       5  3\r\n       5  6\r\n       3  7]\r\n\r\nThen the output matrix B is \r\n\r\n  B = [1  2 \r\n       3  1\r\n       3  2\r\n       2  3]\r\n\r\nPlease try to avoid for or while loops. Vectorized code will be more appreciated. ","description_html":"\u003cp\u003eProvided is an m-by-n integer data matrix A whose elements are drawn arbitrarily from a set \u003cb\u003eS\u003c/b\u003e = [1,2,3,...,S] for any large integer number S \u0026gt; 1. The \"arbitrary\" manner of drawing integer numbers implies that each column of A might contain only a subset of integer numbers from \u003cb\u003eS\u003c/b\u003e. Our objective is to regularize the data in A subject to the following rules:\u003c/p\u003e\u003cp\u003eFor each column in A,\u003c/p\u003e\u003cul\u003e\u003cli\u003eThe smallest number or numbers (if there are more than one such number) are mapped to 1;\u003c/li\u003e\u003cli\u003eThe 2nd-smallest number or numbers (if there are more than one such number) are mapped to 2;\u003c/li\u003e\u003cli\u003eThe \u003ci\u003ek\u003c/i\u003e th-smallest number or numbers (if there are more than one such number) are mapped to \u003ci\u003ek\u003c/i\u003e .\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eFor example, \u003cb\u003eS\u003c/b\u003e = [1:8] with S = 8. Suppose the input data matrix A is\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [2  6\r\n     5  3\r\n     5  6\r\n     3  7]\r\n\u003c/pre\u003e\u003cp\u003eThen the output matrix B is\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eB = [1  2 \r\n     3  1\r\n     3  2\r\n     2  3]\r\n\u003c/pre\u003e\u003cp\u003ePlease try to avoid for or while loops. Vectorized code will be more appreciated.\u003c/p\u003e","function_template":"function B = regular(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nfiletext = fileread('regular.m');\r\nassert(isempty(strfind(filetext, 'for')))\r\nassert(isempty(strfind(filetext, 'while')))\r\n\r\n%%\r\nA = 1;\r\nB = 1;\r\nassert(isequal(regular(A),B));\r\n\r\n%%\r\nA = [2     6\r\n     5     3\r\n     5     6\r\n     3     7];\r\nB = [1     2\r\n     3     1\r\n     3     2\r\n     2     3];\r\nassert(isequal(regular(A),B));\r\n\r\n%%\r\nA = [10    2     4     4     2\r\n     4     5     6     8     1\r\n     6     5    10     3     9\r\n     9     9     5     5     5\r\n     9    10     3     7     8];\r\nB = [4     1     2     2     2\r\n     1     2     4     5     1\r\n     2     2     5     1     5\r\n     3     3     3     3     3\r\n     3     4     1     4     4];\r\nassert(isequal(regular(A),B));\r\n\r\n%%\r\nA = randi(100,80,100);\r\nB = zeros(size(A));\r\nfor iter = 1:size(A,2)\r\n    [~, ~, B(:, iter)] = unique(A(:,iter)); \r\nend\r\nassert(isequal(regular(A),B));\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":6,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":50,"test_suite_updated_at":"2015-08-12T07:02:47.000Z","rescore_all_solutions":false,"group_id":24,"created_at":"2015-08-12T00:30:34.000Z","updated_at":"2026-04-02T22:09:43.000Z","published_at":"2015-08-12T00:56: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\u003eProvided is an m-by-n integer data matrix A whose elements are drawn arbitrarily from a set\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\u003eS\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = [1,2,3,...,S] for any large integer number S \u0026gt; 1. The \\\"arbitrary\\\" manner of drawing integer numbers implies that each column of A might contain only a subset of integer numbers from\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\u003eS\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Our objective is to regularize the data in A subject 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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor each column in A,\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\u003eThe smallest number or numbers (if there are more than one such number) are mapped to 1;\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\u003eThe 2nd-smallest number or numbers (if there are more than one such number) are mapped to 2;\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\u003eThe\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e th-smallest number or numbers (if there are more than one such number) are mapped to\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ek\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\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example,\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\u003eS\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = [1:8] with S = 8. Suppose the input data matrix A is\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[A = [2  6\\n     5  3\\n     5  6\\n     3  7]]]\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 matrix B is\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[B = [1  2 \\n     3  1\\n     3  2\\n     2  3]]]\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\u003ePlease try to avoid for or while loops. Vectorized code will be more appreciated.\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\"}]}"}],"term":"group:\"Matrix Manipulation III\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"group:\"Matrix Manipulation III\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"group":[["group:\"Matrix Manipulation III\"","","\"","Matrix Manipulation III","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007faf1772f330\u003e":["Matrix Manipulation III"],"#\u003cMathWorks::Search::Field:0x00007faf1772f290\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007faf1772e930\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007faf1772f650\u003e":1,"#\u003cMathWorks::Search::Field:0x00007faf1772f5b0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007faf1772f510\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007faf1772f3d0\u003e":"group:\"Matrix Manipulation III\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007faf1772f3d0\u003e":"group:\"Matrix Manipulation III\""},"queried_facets":{"#\u003cMathWorks::Search::Field:0x00007faf1772f330\u003e":["Matrix Manipulation III"]}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"cody-search","password":"78X075ddcV44","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"group:\"Matrix Manipulation III\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"group":[["group:\"Matrix Manipulation III\"","","\"","Matrix Manipulation III","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007faf1772f330\u003e":["Matrix Manipulation III"],"#\u003cMathWorks::Search::Field:0x00007faf1772f290\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007faf1772e930\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007faf1772f650\u003e":1,"#\u003cMathWorks::Search::Field:0x00007faf1772f5b0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007faf1772f510\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007faf1772f3d0\u003e":"group:\"Matrix Manipulation III\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007faf1772f3d0\u003e":"group:\"Matrix Manipulation III\""},"queried_facets":{"#\u003cMathWorks::Search::Field:0x00007faf1772f330\u003e":["Matrix Manipulation III"]}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":42590,"difficulty_rating":"easy"},{"id":42695,"difficulty_rating":"easy"},{"id":43609,"difficulty_rating":"easy"},{"id":43964,"difficulty_rating":"easy-medium"},{"id":43803,"difficulty_rating":"easy-medium"},{"id":42854,"difficulty_rating":"easy-medium"},{"id":42639,"difficulty_rating":"easy-medium"},{"id":42763,"difficulty_rating":"easy-medium"},{"id":42858,"difficulty_rating":"easy-medium"},{"id":42761,"difficulty_rating":"easy-medium"},{"id":43966,"difficulty_rating":"easy-medium"},{"id":42798,"difficulty_rating":"easy-medium"},{"id":42635,"difficulty_rating":"easy-medium"},{"id":42856,"difficulty_rating":"easy-medium"},{"id":42634,"difficulty_rating":"medium"},{"id":2700,"difficulty_rating":"medium"},{"id":42631,"difficulty_rating":"medium"},{"id":42633,"difficulty_rating":"medium"},{"id":44080,"difficulty_rating":"medium-hard"},{"id":42504,"difficulty_rating":"medium-hard"}]}}