{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.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":"2025-12-14T00: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":43333,"title":"Save variables","description":"a=[1]\r\n\r\nSave variable a that is located in workspace into current folder. File name should be 'a.mat'","description_html":"\u003cp\u003ea=[1]\u003c/p\u003e\u003cp\u003eSave variable a that is located in workspace into current folder. File name should be 'a.mat'\u003c/p\u003e","function_template":"function y = savevar(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\nsavevar(a)\r\nii=ls('a.mat')\r\nassert(~isempty(ii))\r\n\r\n%%\r\nclear\r\nload a\r\nassert(a==1)","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2016-10-15T04:35:08.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-11T14:13:40.000Z","updated_at":"2026-02-06T12:20:54.000Z","published_at":"2016-10-11T14:13:40.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\u003ea=[1]\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\u003eSave variable a that is located in workspace into current folder. File name should be 'a.mat'\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":43156,"title":"Find x in provided equation!","description":"x^2-2*x+1=0\r\n\r\nThis polynomial can be expressed by using each term's coefficients, such as\r\n\r\n[1 -2 1].\r\n\r\nUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \"roots\")","description_html":"\u003cp\u003ex^2-2*x+1=0\u003c/p\u003e\u003cp\u003eThis polynomial can be expressed by using each term's coefficients, such as\u003c/p\u003e\u003cp\u003e[1 -2 1].\u003c/p\u003e\u003cp\u003eUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \"roots\")\u003c/p\u003e","function_template":"function y = solvepol(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 -2 1];\r\ny_correct = [1;1];\r\nassert(isequal(solvepol(x),y_correct))\r\n\r\n%%\r\nx = [1 -3 2];\r\ny_correct = [2;1];\r\nassert(isequal(solvepol(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":120,"test_suite_updated_at":"2016-10-21T06:37:13.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T13:48:30.000Z","updated_at":"2026-02-05T18:05:42.000Z","published_at":"2016-10-07T13:48: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\",\"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\u003ex^2-2*x+1=0\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 polynomial can be expressed by using each term's coefficients, such as\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\u003e[1 -2 1].\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\u003eUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \\\"roots\\\")\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":43314,"title":"Change matrix to vector","description":"Vector is a matrix whose size is 1 x n or n x 1.\r\n\r\nChange matrix to vector.\r\n\r\n  x =\r\n  \r\n       4     3\r\n       5     1\r\n       5     1\r\n\r\ninput x should change to output y.\r\n\r\n  y =\r\n  \r\n       4\r\n       5\r\n       5\r\n       3\r\n       1\r\n       1","description_html":"\u003cp\u003eVector is a matrix whose size is 1 x n or n x 1.\u003c/p\u003e\u003cp\u003eChange matrix to vector.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex =\r\n\u003c/pre\u003e\u003cpre\u003e       4     3\r\n       5     1\r\n       5     1\u003c/pre\u003e\u003cp\u003einput x should change to output y.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey =\r\n\u003c/pre\u003e\u003cpre\u003e       4\r\n       5\r\n       5\r\n       3\r\n       1\r\n       1\u003c/pre\u003e","function_template":"function y = rearrange(x)\r\n  y =\r\nend","test_suite":"%%\r\nx = [  2     3\r\n       3     4\r\n       3     4];\r\ny_correct = [2;3;3;3;4;4];\r\nassert(isequal(rearrange(x),y_correct))\r\n\r\n%%\r\nx = [  4     3\r\n       5     1\r\n       5     1];\r\ny_correct = [4;5;5;3;1;1];\r\nassert(isequal(rearrange(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":204,"test_suite_updated_at":"2016-10-15T04:42:30.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T14:39:54.000Z","updated_at":"2026-02-11T18:22:52.000Z","published_at":"2016-10-10T14:39: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\u003eVector is a matrix whose size is 1 x n or n x 1.\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\u003eChange matrix to vector.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x =\\n\\n       4     3\\n       5     1\\n       5     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\u003einput x should change to output y.\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 =\\n\\n       4\\n       5\\n       5\\n       3\\n       1\\n       1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43552,"title":"Calculate solution of given polynomial","description":"For example,\r\n\r\ny=function([3 -2 -4])\r\n\r\nIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\r\n\r\ny=[1.5352; -0.8685]","description_html":"\u003cp\u003eFor example,\u003c/p\u003e\u003cp\u003ey=function([3 -2 -4])\u003c/p\u003e\u003cp\u003eIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\u003c/p\u003e\u003cp\u003ey=[1.5352; -0.8685]\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [3 -2 -4];\r\ny_correct = [  1.5352\r\n              -0.8685];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx = [1 2 1];\r\ny_correct = [-1;-1];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx = [1 2 2];\r\ny_correct = [  -1.0000 + 1.0000i\r\n               -1.0000 - 1.0000i];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":97,"test_suite_updated_at":"2016-10-15T04:16:27.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-14T11:53:24.000Z","updated_at":"2026-02-17T08:26:30.000Z","published_at":"2016-10-14T11:53:24.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\u003eFor example,\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\u003ey=function([3 -2 -4])\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\u003eIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\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\u003ey=[1.5352; -0.8685]\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":43308,"title":"Calculate some equation","description":"Using given inputs x and z, make two outputs that are\r\n\r\n y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\r\n\r\n y2 = x^z - z^x + (x/z)^2 - (z/x)^2\r\n\r\n","description_html":"\u003cp\u003eUsing given inputs x and z, make two outputs that are\u003c/p\u003e\u003cpre\u003e y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\u003c/pre\u003e\u003cpre\u003e y2 = x^z - z^x + (x/z)^2 - (z/x)^2\u003c/pre\u003e","function_template":"function [y1 y2] = calculate_eq(x,z)\r\n  y1 =\r\n  y2 =  \r\nend","test_suite":"%%\r\nx = 1;\r\nz = 1;\r\ny1=14.2000\r\ny2=0\r\n\r\n[y11,y22]=calculate_eq(x,z)\r\nassert( abs(y1-y11)+abs(y2-y22)\u003c0.001 )\r\n\r\n\r\n%%\r\nx = 2;\r\nz = 1;\r\ny1= 55.7000\r\ny2=4.7500\r\n\r\n[y11,y22]=calculate_eq(x,z)\r\nassert( abs(y1-y11)+abs(y2-y22)\u003c0.001 )\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":164,"test_suite_updated_at":"2016-10-15T04:52:37.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T13:09:03.000Z","updated_at":"2026-02-18T21:55:46.000Z","published_at":"2016-10-10T13:09:03.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\u003eUsing given inputs x and z, make two outputs that are\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[ y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\\n\\n y2 = x^z - z^x + (x/z)^2 - (z/x)^2]]\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":43488,"title":"Print true if ","description":"all elements are larger than 5\r\n\r\n  a=[1 3 5 8 6];\r\n  b=[6 6 6 6 6];\r\n\r\nfunction(a) should be false, and function(b) will be true.\r\n","description_html":"\u003cp\u003eall elements are larger than 5\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea=[1 3 5 8 6];\r\nb=[6 6 6 6 6];\r\n\u003c/pre\u003e\u003cp\u003efunction(a) should be false, and function(b) will be true.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [6 6 6 6 6 6 6 6 ];\r\ny_correct = true;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [6 6 6 1 6 6 6 6 ];\r\ny_correct = false;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [6 6 9 6 6 6 9 1 ];\r\ny_correct = false;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":153,"test_suite_updated_at":"2016-10-15T04:19:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-12T13:22:38.000Z","updated_at":"2026-02-13T15:31:15.000Z","published_at":"2016-10-12T13:22:38.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\u003eall elements are larger than 5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a=[1 3 5 8 6];\\nb=[6 6 6 6 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\u003efunction(a) should be false, and function(b) will be true.\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":43190,"title":"Determine point is located in a circle or not","description":"Using input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\r\nif point is located in circle, output is true.","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\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: 269px 8px; transform-origin: 269px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsing input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\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: 126.5px 8px; transform-origin: 126.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eif point is located in circle, output is true.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = inorout(x,y)\r\n  z=true\r\nend","test_suite":"%%\r\nx = 1;\r\ny = 2;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny = 0;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 0.5;\r\ny = 0.5;\r\ny_correct = 1;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = -1;\r\ny = -1;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 0;\r\ny = 0;\r\ny_correct = 1;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny = 3;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":223089,"edited_at":"2022-09-09T07:58:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2022-09-09T07:58:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T06:42:36.000Z","updated_at":"2026-02-18T10:12:49.000Z","published_at":"2016-10-08T06:42:36.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\u003eUsing input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\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\u003eif point is located in circle, output is true.\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":43311,"title":"How to calculate log?","description":"There is a log that have base 5. How to calculate?\r\n\r\nlog5(x)?","description_html":"\u003cp\u003eThere is a log that have base 5. How to calculate?\u003c/p\u003e\u003cp\u003elog5(x)?\u003c/p\u003e","function_template":"function y = log5(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 5;\r\ny_correct = 1;\r\nassert(isequal(log5(x),y_correct))\r\n\r\n%%\r\nx = 25;\r\ny_correct = 2;\r\nassert(isequal(log5(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":11,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":189,"test_suite_updated_at":"2016-10-15T04:46:34.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T13:19:22.000Z","updated_at":"2026-02-18T11:18:10.000Z","published_at":"2016-10-10T13:19:22.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\u003eThere is a log that have base 5. How to calculate?\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\u003elog5(x)?\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":43161,"title":"Replace 0 to NaN!","description":"In given matrix\r\n\r\nA=[1 nan nan; 2 2 nan; nan nan 1];\r\n\r\nreplace NaN to 0. Use matrix A as a input.","description_html":"\u003cp\u003eIn given matrix\u003c/p\u003e\u003cp\u003eA=[1 nan nan; 2 2 nan; nan nan 1];\u003c/p\u003e\u003cp\u003ereplace NaN to 0. Use matrix A as a input.\u003c/p\u003e","function_template":"function y = nan2zero(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx=[1 nan nan; 2 2 nan; nan nan 1];\r\ny_correct = [1 0 0; 2 2 0; 0 0 1];\r\nassert(all(all(nan2zero(x)==y_correct)))\r\n\r\n%%\r\nx=[nan nan];\r\ny_correct = [0 0];\r\nassert(all(all(nan2zero(x)==y_correct)))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":105,"test_suite_updated_at":"2016-10-21T06:46:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T14:44:39.000Z","updated_at":"2026-03-09T20:55:18.000Z","published_at":"2016-10-07T14:44: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\",\"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 given 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\u003eA=[1 nan nan; 2 2 nan; nan nan 1];\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\u003ereplace NaN to 0. Use matrix A as a input.\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":43185,"title":"How to permute given 3d matrix?","description":"  A(:,:,1)=[1 3]\r\n  A(:,:,2)=[2 2]\r\n  A(:,:,3)=[4 3]\r\n\r\nChange rows to columns and columns to rows, similar to transpose.\r\nResult should be\r\n\r\n  A(:,:,1)=[1;3]\r\n  A(:,:,2)=[2;2]\r\n  A(:,:,3)=[4;3]\r\n\r\n(hint: use permute)","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: 194.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 97.3px; transform-origin: 407px 97.3px; vertical-align: baseline; \"\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; 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 30.65px; transform-origin: 404px 30.65px; 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: 56px 8.5px; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,1)=[1 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; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,2)=[2 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: 56px 8.5px; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,3)=[4 3]\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: 266.5px 8px; transform-origin: 266.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eChange rows to columns and columns to rows, similar to transpose. Result should be\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; 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 30.65px; transform-origin: 404px 30.65px; 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: 56px 8.5px; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,1)=[1;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; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,2)=[2;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: 56px 8.5px; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,3)=[4;3]\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: 60px 8px; transform-origin: 60px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(hint: use permute)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = mypermute(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nA(:,:,1) = [1,3]; A(:,:,2) = [2,2]; A(:,:,3) = [4,3];\r\nA_p(:,:,1) = [1;3]; A_p(:,:,2) = [2;2]; A_p(:,:,3) = [4;3];\r\nassert(isequal(mypermute(A),A_p))\r\n\r\n%%\r\nA(:,:,1) = [2;3]; A(:,:,2) = [3;2]; A(:,:,3) = [4;3];\r\nA_p(:,:,1) = [2,3]; A_p(:,:,2) = [3,2]; A_p(:,:,3) = [4,3];\r\nassert(isequal(mypermute(A),A_p))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2020-12-21T14:24:23.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T03:00:49.000Z","updated_at":"2026-03-11T08:28:03.000Z","published_at":"2016-10-08T03:00:49.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[A(:,:,1)=[1 3]\\nA(:,:,2)=[2 2]\\nA(:,:,3)=[4 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChange rows to columns and columns to rows, similar to transpose. Result 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[A(:,:,1)=[1;3]\\nA(:,:,2)=[2;2]\\nA(:,:,3)=[4;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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(hint: use permute)\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":43274,"title":"Calculate correlation.","description":"There are two data.\r\n\r\n  y1=[0 1 2 3 4]'\r\n  y2=[2 3 4 5 6]'\r\n\r\nWe can see positive relationship between y1 and y2. The relationship between two data can be estimated using correlation coefficients.\r\n\r\nhttps://en.wikipedia.org/wiki/Correlation_and_dependence\r\n\r\nCalculate this between y1 and y2.\r\n\r\n","description_html":"\u003cp\u003eThere are two data.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey1=[0 1 2 3 4]'\r\ny2=[2 3 4 5 6]'\r\n\u003c/pre\u003e\u003cp\u003eWe can see positive relationship between y1 and y2. The relationship between two data can be estimated using correlation coefficients.\u003c/p\u003e\u003cp\u003ehttps://en.wikipedia.org/wiki/Correlation_and_dependence\u003c/p\u003e\u003cp\u003eCalculate this between y1 and y2.\u003c/p\u003e","function_template":"function y = mycorr(y1,y2)\r\n\r\n    y=\r\n    \r\nend","test_suite":"%%\r\ny1=[0 1 2 3 4]'\r\ny2=-[2 3 4 5 6]'\r\ny_correct = -1;\r\nassert(isequal(mycorr(y1,y2),y_correct))\r\n\r\n\r\n%%\r\ny1=[0 1 2 3 4]'\r\ny2=[2 3 4 5 6]'\r\ny_correct = 1;\r\nassert(isequal(mycorr(y1,y2),y_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":1,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":73,"test_suite_updated_at":"2016-10-15T07:49:56.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-09T10:55:01.000Z","updated_at":"2026-03-04T14:28:22.000Z","published_at":"2016-10-09T10:55:01.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\u003eThere are two data.\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[y1=[0 1 2 3 4]'\\ny2=[2 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\u003eWe can see positive relationship between y1 and y2. The relationship between two data can be estimated using correlation coefficients.\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:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Correlation_and_dependence\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttps://en.wikipedia.org/wiki/Correlation_and_dependence\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:t\u003eCalculate this between y1 and y2.\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":43183,"title":"Removing vibration!","description":"There are [y] that vary with [x] but y including small useless vibration.\r\n\r\n x=1:10\r\n y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03]\r\n\r\nRemove the vibration using moving average. processed vector yp is calculated follow these method.\r\n\r\nyp(1)=(y(1)+y(2)+y(3))/3\r\n\r\nyp(2)=(y(2)+y(3)+y(4))/3\r\n\r\nyp(3)=(y(3)+y(4)+y(5))/3 ...\r\n\r\n(hint: conv function)\r\n\r\n","description_html":"\u003cp\u003eThere are [y] that vary with [x] but y including small useless vibration.\u003c/p\u003e\u003cpre\u003e x=1:10\r\n y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03]\u003c/pre\u003e\u003cp\u003eRemove the vibration using moving average. processed vector yp is calculated follow these method.\u003c/p\u003e\u003cp\u003eyp(1)=(y(1)+y(2)+y(3))/3\u003c/p\u003e\u003cp\u003eyp(2)=(y(2)+y(3)+y(4))/3\u003c/p\u003e\u003cp\u003eyp(3)=(y(3)+y(4)+y(5))/3 ...\u003c/p\u003e\u003cp\u003e(hint: conv function)\u003c/p\u003e","function_template":"function z = mysmooth(x)\r\n x=1:10\r\n y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03]\r\n z=x\r\nend","test_suite":"%%\r\nx = [1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03];\r\ny_correct = [2.340 3.120 4.143 5.323 6.536 7.610 8.653 9.433];\r\nassert((mean(mysmooth(x)-y_correct)\u003c0.001))\r\n\r\n%%\r\nx=[1 1 1]\r\ny_correct=1\r\nassert((mean(mysmooth(x)-y_correct)\u003c0.001))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":"2016-10-25T04:24:35.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T02:31:36.000Z","updated_at":"2026-03-03T10:50:49.000Z","published_at":"2016-10-08T02:31:36.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\u003eThere are [y] that vary with [x] but y including small useless vibration.\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=1:10\\n y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03]]]\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\u003eRemove the vibration using moving average. processed vector yp is calculated follow these method.\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\u003eyp(1)=(y(1)+y(2)+y(3))/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\u003eyp(2)=(y(2)+y(3)+y(4))/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\u003eyp(3)=(y(3)+y(4)+y(5))/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\u003e(hint: conv 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":43221,"title":"Interpolate scattered data.","description":"Most data was scattered, and there is no gird.\r\n\r\nThere are three data [c] in three different area [x,y].\r\n\r\n x=[1 3 4];\r\n y=[1 2 1];\r\n c=[2 3 5];\r\n\r\nEstimate data value in x=2.6, y=1.4 using interpolation. x,y,c are used as inputs.\r\n\r\n(hint: use griddata)\r\n","description_html":"\u003cp\u003eMost data was scattered, and there is no gird.\u003c/p\u003e\u003cp\u003eThere are three data [c] in three different area [x,y].\u003c/p\u003e\u003cpre\u003e x=[1 3 4];\r\n y=[1 2 1];\r\n c=[2 3 5];\u003c/pre\u003e\u003cp\u003eEstimate data value in x=2.6, y=1.4 using interpolation. x,y,c are used as inputs.\u003c/p\u003e\u003cp\u003e(hint: use griddata)\u003c/p\u003e","function_template":"function z = datinter(x,y,c) \r\n z=?\r\nend","test_suite":"%%\r\n x=[1 3 4];\r\n y=[1 2 1];\r\n c=[2 3 5];\r\ny_correct = griddata(x,y,c,2.6,1.4);\r\nassert(isequal(datinter(x,y,c),y_correct))\r\n\r\n%%\r\n x=[1 2 4];\r\n y=[1 2 1.2];\r\n c=[2 6 9];\r\ny_correct = griddata(x,y,c,2.6,1.4);\r\nassert(isequal(datinter(x,y,c),y_correct))\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2016-10-15T07:58:27.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-08T13:14:32.000Z","updated_at":"2026-03-05T15:57:44.000Z","published_at":"2016-10-08T13:15:37.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\u003eMost data was scattered, and there is no gird.\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\u003eThere are three data [c] in three different area [x,y].\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=[1 3 4];\\n y=[1 2 1];\\n c=[2 3 5];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEstimate data value in x=2.6, y=1.4 using interpolation. x,y,c are used as 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:t\u003e(hint: use griddata)\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":43282,"title":"Analyze observation data","description":"Suppose you have the following data (A,B,C) in three-column format.\r\n\r\n     A       B       C\r\n--------------------------\r\nt=1  2.2     2.6     2.4\r\nt=2  2.4     2.8     2.2 \r\nt=3  2.6     2.7     2.4 \r\nt=4  2.7     2.6     2.5\r\nt=5  2.6     2.5     2.6\r\nt=6  2.5     2.4     3.0\r\n\r\nWrite a function to find and return the maximum value from each column as well as its time index. For the supplied example, A has a maximum value of 2.7 when t=4, B has a maximum of 2.8 when t=2, and C has a maximum of 3.0 when t=6. Therefore, the function should output:\r\n\r\n\r\n m = [2.7 2.8 3.0]   tm = [4 2 6]","description_html":"\u003cp\u003eSuppose you have the following data (A,B,C) in three-column format.\u003c/p\u003e\u003cpre\u003e     A       B       C\r\n--------------------------\r\nt=1  2.2     2.6     2.4\r\nt=2  2.4     2.8     2.2 \r\nt=3  2.6     2.7     2.4 \r\nt=4  2.7     2.6     2.5\r\nt=5  2.6     2.5     2.6\r\nt=6  2.5     2.4     3.0\u003c/pre\u003e\u003cp\u003eWrite a function to find and return the maximum value from each column as well as its time index. For the supplied example, A has a maximum value of 2.7 when t=4, B has a maximum of 2.8 when t=2, and C has a maximum of 3.0 when t=6. Therefore, the function should output:\u003c/p\u003e\u003cpre\u003e m = [2.7 2.8 3.0]   tm = [4 2 6]\u003c/pre\u003e","function_template":"function [m,tm] = data_process(x)\r\n  m =\r\n  tm =\r\nend","test_suite":"%%\r\nx=[2.2     2.6     2.4\r\n   2.4     2.8     2.2\r\n   2.6     2.7     2.4 \r\n   2.7     2.6     2.5\r\n   2.6     2.5     2.6\r\n   2.5     2.4     3.0];\r\n\r\nmi=[2.7,2.8,3.0];\r\ntmi=[4,2,6];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n\r\n%%\r\nx=[2.2     2.6     2.4\r\n   2.4     2.8     2.2\r\n   2.6     7.7     2.4 \r\n   9.7     2.6     2.5\r\n   2.6     2.5     2.6\r\n   2.5     2.4     7.0];\r\n\r\nmi=[9.7,7.7,7.0];\r\ntmi=[4,3,6];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n\r\n%%\r\nx=[1.2     1.6     8.4\r\n   4.4     2.8     7.2\r\n   3.6     1.7     2.4 \r\n   1.1     2.4     5.5\r\n   2.3     2.6     2.6\r\n   7.4     7.4     3.0];\r\n\r\nmi=[7.4,7.4,8.4];\r\ntmi=[6,6,1];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n\r\n%%\r\nx=[2.1     6.6     3.5\r\n   4.7     8.2     4.5\r\n   6.3     7.1     2.5 \r\n   8.1     4.4     3.7\r\n   5.2     3.7     1.6\r\n   1.3     7.1     1.0];\r\n\r\nmi=[8.1,8.2,4.5];\r\ntmi=[4,2,2];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n\r\n%%\r\nx=[9.1     9.8     9.5\r\n   9.7     9.2     9.1\r\n   9.9     9.5     9.2 \r\n   9.1     9.4     9.7\r\n   9.2     9.7     9.6\r\n   9.3     9.3     9.0];\r\n\r\nmi=[9.9,9.8,9.7];\r\ntmi=[3,1,4];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":1,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":71,"test_suite_updated_at":"2016-11-22T19:02:55.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T14:34:07.000Z","updated_at":"2026-03-12T23:59:59.000Z","published_at":"2016-10-09T14:34:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose you have the following data (A,B,C) in three-column format.\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       B       C\\n--------------------------\\nt=1  2.2     2.6     2.4\\nt=2  2.4     2.8     2.2 \\nt=3  2.6     2.7     2.4 \\nt=4  2.7     2.6     2.5\\nt=5  2.6     2.5     2.6\\nt=6  2.5     2.4     3.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\u003eWrite a function to find and return the maximum value from each column as well as its time index. For the supplied example, A has a maximum value of 2.7 when t=4, B has a maximum of 2.8 when t=2, and C has a maximum of 3.0 when t=6. Therefore, the function should 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[ m = [2.7 2.8 3.0]   tm = [4 2 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":43279,"title":"Weighted moving average","description":"x1=[1 2 1];\r\ny1=[1 2 2 4 5 6 6 8];\r\n\r\nMake function for weighted moving average.\r\n\r\nz(i)=(x1(i)*y1(i)+x1(i+1)*y1(i+1)+x1(i+2)*y1(i+2))/3\r\n\r\nAs a result,\r\n\r\n  z =\r\n\r\n    2.3333    3.3333    5.0000    6.6667    7.6667    8.6667\r\n","description_html":"\u003cp\u003ex1=[1 2 1];\r\ny1=[1 2 2 4 5 6 6 8];\u003c/p\u003e\u003cp\u003eMake function for weighted moving average.\u003c/p\u003e\u003cp\u003ez(i)=(x1(i)*y1(i)+x1(i+1)*y1(i+1)+x1(i+2)*y1(i+2))/3\u003c/p\u003e\u003cp\u003eAs a result,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ez =\r\n\u003c/pre\u003e\u003cpre\u003e    2.3333    3.3333    5.0000    6.6667    7.6667    8.6667\u003c/pre\u003e","function_template":"function z = smooth1dconv(x1,y1)\r\n  z = \r\nend","test_suite":"%%\r\nx1=[1 2 1]; y1=[1 2 2 4 5 6 6 8];\r\ny_correct = [2.3333    3.3333    5.0000    6.6667    7.6667    8.6667];\r\nassert(sum(abs(smooth1dconv(x1,y1)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx1=[1 2 1]; y1=[1 1 1 1 1 1 1 1];\r\ny_correct = [1.3333    1.3333    1.3333    1.3333    1.3333    1.3333];\r\nassert(sum(abs(smooth1dconv(x1,y1)-y_correct))\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2016-10-15T07:46:37.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T12:41:13.000Z","updated_at":"2026-03-28T21:10:37.000Z","published_at":"2016-10-09T12:41: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\u003ex1=[1 2 1]; y1=[1 2 2 4 5 6 6 8];\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\u003eMake function for weighted moving average.\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\u003ez(i)=(x1(i)*y1(i)+x1(i+1)*y1(i+1)+x1(i+2)*y1(i+2))/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\u003eAs a result,\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[z =\\n\\n    2.3333    3.3333    5.0000    6.6667    7.6667    8.6667]]\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":43285,"title":"Solve equation numerically","description":"\r\ny'=y\r\n\r\nIn order to solve equation using computer, numerical analysis are needed. 1st order Euler's method is one of the method. above equation can be expressed as\r\n\r\ny(i+1)=y(i)+h*y(i) \r\n\r\ny(1)=1\r\n\r\nCalculate y(10) using h=0.1. Inputs are y(1) and h.\r\n\r\nhttps://en.wikipedia.org/wiki/Euler_method\r\n","description_html":"\u003cp\u003ey'=y\u003c/p\u003e\u003cp\u003eIn order to solve equation using computer, numerical analysis are needed. 1st order Euler's method is one of the method. above equation can be expressed as\u003c/p\u003e\u003cp\u003ey(i+1)=y(i)+h*y(i)\u003c/p\u003e\u003cp\u003ey(1)=1\u003c/p\u003e\u003cp\u003eCalculate y(10) using h=0.1. Inputs are y(1) and h.\u003c/p\u003e\u003cp\u003ehttps://en.wikipedia.org/wiki/Euler_method\u003c/p\u003e","function_template":"function z = e1solver(h,y1)\r\n    y(1)=y1\r\n    \r\n    z =\r\nend","test_suite":"%%\r\nh=0.1\r\ny1=1\r\ny_correct = 2.3579;\r\nassert(abs(e1solver(h,y1)-y_correct)\u003c0.01)\r\n\r\n%%\r\nclc\r\nclear\r\nh=0.1\r\ny1=2\r\ny_correct = 4.7159;\r\nassert(abs(e1solver(h,y1)-y_correct)\u003c0.01)\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2016-10-15T06:09:33.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-09T16:57:45.000Z","updated_at":"2026-03-11T13:42:36.000Z","published_at":"2016-10-09T16:59:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003ey'=y\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\u003eIn order to solve equation using computer, numerical analysis are needed. 1st order Euler's method is one of the method. above equation can be expressed as\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\u003ey(i+1)=y(i)+h*y(i)\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\u003ey(1)=1\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\u003eCalculate y(10) using h=0.1. Inputs are y(1) and h.\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\u003ehttps://en.wikipedia.org/wiki/Euler_method\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":43315,"title":"Change matrix to vector2","description":"From \r\n\r\n  x =\r\n  \r\n       4     3\r\n       5     1\r\n       5     1\r\n\r\nTo\r\n\r\n  y =\r\n  \r\n       4\r\n       3\r\n       5\r\n       1\r\n       5\r\n       1","description_html":"\u003cp\u003eFrom\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex =\r\n\u003c/pre\u003e\u003cpre\u003e       4     3\r\n       5     1\r\n       5     1\u003c/pre\u003e\u003cp\u003eTo\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey =\r\n\u003c/pre\u003e\u003cpre\u003e       4\r\n       3\r\n       5\r\n       1\r\n       5\r\n       1\u003c/pre\u003e","function_template":"function y = rearrange2(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [  4     3\r\n       5     1\r\n       5     1];\r\ny_correct = [4;3;5;1;5;1];\r\nassert(isequal(rearrange2(x),y_correct))\r\n\r\n%%\r\nx = [  2     4\r\n       1     4\r\n       1     2];\r\ny_correct = [2;4;1;4;1;2];\r\nassert(isequal(rearrange2(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":118,"test_suite_updated_at":"2016-10-15T04:41:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T14:41:56.000Z","updated_at":"2026-03-16T11:04:24.000Z","published_at":"2016-10-10T14:41:56.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\u003eFrom\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 =\\n\\n       4     3\\n       5     1\\n       5     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\u003eTo\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 =\\n\\n       4\\n       3\\n       5\\n       1\\n       5\\n       1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43281,"title":"Two dimensional moving average","description":" A=[1 2 3 4 5\r\n    1 2 2 2 3\r\n    2 3 3 3 4\r\n    1 1 4 4 2]\r\n\r\n B=[1 1;1 1]; % This is can be used for weight factor of moving average\r\n\r\nCalculate two dimensional moving averaged matrix of A\r\n\r\ny(i,j)=A(i,j)*B(1,1)+A(i+1,j)*B(2,1)+A(i,j+1)*B(1,2)+A(i+1,j+1)*B(2,2)\r\n\r\nAs a result,\r\n\r\n  ans =\r\n\r\n    1.5000    2.2500    2.7500    3.5000\r\n    2.0000    2.5000    2.5000    3.0000\r\n    1.7500    2.7500    3.5000    3.2500","description_html":"\u003cpre\u003e A=[1 2 3 4 5\r\n    1 2 2 2 3\r\n    2 3 3 3 4\r\n    1 1 4 4 2]\u003c/pre\u003e\u003cpre\u003e B=[1 1;1 1]; % This is can be used for weight factor of moving average\u003c/pre\u003e\u003cp\u003eCalculate two dimensional moving averaged matrix of A\u003c/p\u003e\u003cp\u003ey(i,j)=A(i,j)*B(1,1)+A(i+1,j)*B(2,1)+A(i,j+1)*B(1,2)+A(i+1,j+1)*B(2,2)\u003c/p\u003e\u003cp\u003eAs a result,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eans =\r\n\u003c/pre\u003e\u003cpre\u003e    1.5000    2.2500    2.7500    3.5000\r\n    2.0000    2.5000    2.5000    3.0000\r\n    1.7500    2.7500    3.5000    3.2500\u003c/pre\u003e","function_template":"function y = smooth2dconv(A,B)\r\n  y = \r\nend","test_suite":"%%\r\nA=[1 2 3 4 5\r\n   1 2 2 2 3\r\n   2 3 3 3 4\r\n   1 1 4 4 2];\r\nB=[1 1;1 1];\r\ny_correct = [    1.5000    2.2500    2.7500    3.5000\r\n                 2.0000    2.5000    2.5000    3.0000\r\n                 1.7500    2.7500    3.5000    3.2500]\r\nassert(isequal(smooth2dconv(A,B),y_correct))\r\n\r\n%%\r\nA=[1 1 3 4\r\n   1 2 1 2\r\n   2 3 3 1\r\n   1 1 4 4];\r\nB=[1 2;2 1];\r\ny_correct = [       1.7500    3.0000    3.7500\r\n                    3.0000    3.2500    3.0000\r\n                    2.7500    3.7500    4.2500]\r\nassert(isequal(smooth2dconv(A,B),y_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":46,"test_suite_updated_at":"2016-10-15T07:36:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T13:35:27.000Z","updated_at":"2025-11-30T18:28:47.000Z","published_at":"2016-10-09T13:35: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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ A=[1 2 3 4 5\\n    1 2 2 2 3\\n    2 3 3 3 4\\n    1 1 4 4 2]\\n\\n B=[1 1;1 1]; % This is can be used for weight factor of moving average]]\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\u003eCalculate two dimensional moving averaged matrix 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\u003ey(i,j)=A(i,j)*B(1,1)+A(i+1,j)*B(2,1)+A(i,j+1)*B(1,2)+A(i+1,j+1)*B(2,2)\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\u003eAs a result,\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[ans =\\n\\n    1.5000    2.2500    2.7500    3.5000\\n    2.0000    2.5000    2.5000    3.0000\\n    1.7500    2.7500    3.5000    3.2500]]\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":43177,"title":"Extract a specific part of matrix!","description":"In the given matrix, extract element that have odd rows and column number.\r\n\r\nFor example\r\n\r\n  A=[1 4 2 3 5]\r\n  B=extractodd(A);\r\n\r\nB should be\r\n\r\n  [1 2 5]\r\n\r\nAnd, if A is\r\n\r\n  [1 2 3\r\n   4 5 6\r\n   7 8 9]\r\n\r\nB should be\r\n\r\n  [1 3\r\n   7 9]","description_html":"\u003cp\u003eIn the given matrix, extract element that have odd rows and column number.\u003c/p\u003e\u003cp\u003eFor example\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA=[1 4 2 3 5]\r\nB=extractodd(A);\r\n\u003c/pre\u003e\u003cp\u003eB should be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1 2 5]\r\n\u003c/pre\u003e\u003cp\u003eAnd, if A is\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1 2 3\r\n 4 5 6\r\n 7 8 9]\r\n\u003c/pre\u003e\u003cp\u003eB should be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1 3\r\n 7 9]\r\n\u003c/pre\u003e","function_template":"function y = extractodd(x)\r\n    y=\r\nend","test_suite":"%%\r\n  x=[1 2 3;\r\n     4 5 6;\r\n     7 8 9]\r\ny_correct = [1 3;7 9]\r\nassert(isequal(extractodd(x),y_correct))\r\n\r\n%%\r\n  x=[1 3 5 7 9]\r\ny_correct = [1 5 9]\r\nassert(isequal(extractodd(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":83,"test_suite_updated_at":"2016-10-25T04:38:05.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T18:38:10.000Z","updated_at":"2026-03-23T04:56:58.000Z","published_at":"2016-10-07T18:38:10.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\u003eIn the given matrix, extract element that have odd rows and column number.\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\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 4 2 3 5]\\nB=extractodd(A);]]\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\u003eB 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 2 5]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAnd, if 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[[1 2 3\\n 4 5 6\\n 7 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\u003eB 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 3\\n 7 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":43298,"title":"Calculate area of sector","description":"A=function(r,seta)\r\n\r\nr is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2)*seta;","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eA=function(r,seta)\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003er(m) is radius of sector, seta (radian) is angle of sector, and A (m^2) is its area.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = sectorarea(r,seta)\r\n  y =\r\nend","test_suite":"%%\r\nr=1\r\nseta=pi/2\r\ny_correct = 0.7854;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n\r\n%%\r\nr=2\r\nseta=pi/2\r\ny_correct = pi;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n\r\n%%\r\nr=sqrt(2);\r\nseta=pi/3\r\ny_correct = pi/3;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n\r\n%%\r\nr= 6\r\nseta=pi/6;\r\ny_correct = 3*pi;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n\r\n%%\r\nr= pi\r\nseta= pi\r\ny_correct = 0.5*pi^3;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":21,"comments_count":6,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3452,"test_suite_updated_at":"2021-02-21T07:46:40.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T09:02:12.000Z","updated_at":"2026-04-03T16:02:03.000Z","published_at":"2016-10-10T09:02:12.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\u003eA=function(r,seta)\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\u003er(m) is radius of sector, seta (radian) is angle of sector, and A (m^2) is its area.\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":43193,"title":"Where is 1?","description":"There is a 3d matrix [A] that consist of many zeros and only one.\r\nA=zeros(100,100,100);\r\ni=randi(100);\r\nj=randi(100);\r\nk=randi(100);\r\nA(i,j,k)=1;\r\nWhere is one? Find [i j k].","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: 164.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 82.0833px; transform-origin: 407px 82.0833px; vertical-align: baseline; \"\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: 202px 8px; transform-origin: 202px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThere is a 3d matrix [A] that consist of many zeros and only one.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; 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 51.0833px; transform-origin: 404px 51.0833px; 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: 84px 8.5px; tab-size: 4; transform-origin: 84px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA=zeros(100,100,100);\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: 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; \"\u003ei=randi(100);\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: 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; \"\u003ej=randi(100);\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: 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; \"\u003ek=randi(100);\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: 44px 8.5px; tab-size: 4; transform-origin: 44px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(i,j,k)=1;\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: 80.5px 8px; transform-origin: 80.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWhere is one? Find [i j k].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [i,j,k] = find1number(A)\r\n  i=\r\n  j=\r\n  k=\r\nend","test_suite":"%%\r\nA=zeros(100,100,100);\r\ni=randi(100);\r\nj=randi(100);\r\nk=randi(100);\r\nA(i,j,k)=1;\r\ny=find1number(A)\r\nassert(isequal(y,[i,j,k]))\r\n\r\n%%\r\nA=zeros(100,100,100);\r\ni=randi(100);\r\nj=randi(100);\r\nk=randi(100);\r\nA(i,j,k)=1;\r\ny=find1number(A)\r\nassert(isequal(y,[i,j,k]))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":223089,"edited_at":"2023-01-09T11:23:12.000Z","deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2016-10-15T07:59:42.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T07:59:14.000Z","updated_at":"2025-12-07T21:00:07.000Z","published_at":"2016-10-08T07:59:14.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\u003eThere is a 3d matrix [A] that consist of many zeros and only one.\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=zeros(100,100,100);\\ni=randi(100);\\nj=randi(100);\\nk=randi(100);\\nA(i,j,k)=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\u003eWhere is one? Find [i j k].\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":43301,"title":"Calculate inverse matrix in m by n matrix ","description":"  x=(1:10)'\r\n  y=roundn(2*x+7*rand(size(x)),-1)\r\n\r\na*x=y\r\n\r\nEstimate a using inverse matrix calculation. This is principle of linear regression.","description_html":"\u003cpre class=\"language-matlab\"\u003ex=(1:10)'\r\ny=roundn(2*x+7*rand(size(x)),-1)\r\n\u003c/pre\u003e\u003cp\u003ea*x=y\u003c/p\u003e\u003cp\u003eEstimate a using inverse matrix calculation. This is principle of linear regression.\u003c/p\u003e","function_template":"function a = reginv(x,y)\r\n  a =\r\nend","test_suite":"%%\r\n  x=(1:10)'\r\n  y=3*x\r\n  a=3\r\n\r\nassert(abs(reginv(x,y)-a)\u003c0.001)\r\n\r\n%%\r\n  x=(1:10)'\r\n  y=3*x+2\r\n  a=3.2857\r\n\r\nassert(abs(reginv(x,y)-a)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":"2018-07-19T15:35:54.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T09:36:59.000Z","updated_at":"2026-01-02T15:53:13.000Z","published_at":"2016-10-10T09:36:59.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x=(1:10)'\\ny=roundn(2*x+7*rand(size(x)),-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\u003ea*x=y\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\u003eEstimate a using inverse matrix calculation. This is principle of linear regression.\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":43334,"title":"Solve the system of linear equations","description":"  4x - 2y  +6z=8\r\n  \r\n  2x + 8y  +2z=4\r\n  \r\n  6x + 10y +3z=0\r\n\r\nInput is each coefficient of polynomial. For example,\r\n\r\n  a=[4 -2 6 8;2 8 2 4;6 10 3 0]\r\n\r\nFind x,y,z. Output should be\r\n\r\n b=[x;y;z]\r\n\r\n","description_html":"\u003cpre class=\"language-matlab\"\u003e4x - 2y  +6z=8\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e2x + 8y  +2z=4\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e6x + 10y +3z=0\r\n\u003c/pre\u003e\u003cp\u003eInput is each coefficient of polynomial. For example,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea=[4 -2 6 8;2 8 2 4;6 10 3 0]\r\n\u003c/pre\u003e\u003cp\u003eFind x,y,z. Output should be\u003c/p\u003e\u003cpre\u003e b=[x;y;z]\u003c/pre\u003e","function_template":"function b = solvepol(a)\r\n  b=\r\nend","test_suite":"%%\r\nx=[4 -2 6 8;2 8 2 4;6 10 3 0];\r\ny_correct = [   -1.8049\r\n                 0.2927\r\n                 2.6341];\r\nassert(abs(sum(solvepol(x)-y_correct))\u003c0.01)\r\n\r\n%%\r\nx=[     9    10     3    10\r\n       10     7     6     2\r\n        2     1    10    10];\r\ny_correct = [ -2.6456\r\n               3.0127\r\n               1.2278];\r\nassert(abs(sum(solvepol(x)-y_correct))\u003c0.01)\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":107,"test_suite_updated_at":"2016-10-15T04:33:08.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-11T14:18:34.000Z","updated_at":"2026-04-01T07:49:35.000Z","published_at":"2016-10-11T14:18:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[4x - 2y  +6z=8\\n\\n2x + 8y  +2z=4\\n\\n6x + 10y +3z=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\u003eInput is each coefficient of polynomial. For example,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a=[4 -2 6 8;2 8 2 4;6 10 3 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\u003eFind x,y,z. 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[ b=[x;y;z]]]\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":43235,"title":"Calculate geostrophic current","description":"  eta0=0.01;\r\n  R=300;\r\n  f=0.01;\r\n  g=9.81;\r\n  x=-500:50:500;\r\n  y=-500:50:500;\r\n  [x y]=meshgrid(x,y);\r\n  eta=eta0*exp(-(x.^2+y.^2)/R^2);\r\n\r\neta indicates sea surface height in each point (x,y). Calculate geostrophic current (u,v).\r\n\r\nhttps://en.wikipedia.org/wiki/Geostrophic_current\r\n","description_html":"\u003cpre class=\"language-matlab\"\u003eeta0=0.01;\r\nR=300;\r\nf=0.01;\r\ng=9.81;\r\nx=-500:50:500;\r\ny=-500:50:500;\r\n[x y]=meshgrid(x,y);\r\neta=eta0*exp(-(x.^2+y.^2)/R^2);\r\n\u003c/pre\u003e\u003cp\u003eeta indicates sea surface height in each point (x,y). Calculate geostrophic current (u,v).\u003c/p\u003e\u003cp\u003ehttps://en.wikipedia.org/wiki/Geostrophic_current\u003c/p\u003e","function_template":"function [u,v] = your_fcn_name(x)\r\n  eta0=0.01;\r\n  R=300;\r\n  f=0.01;\r\n  g=9.81;\r\n  x=-500:50:500;\r\n  y=-500:50:500;\r\n  [x y]=meshgrid(x,y);\r\n  eta=eta0*exp(-(x.^2+y.^2)/R^2);\r\n  \r\n  u=\r\n  v=\r\n  \r\nend","test_suite":"%%\r\nx = 1;\r\neta0=0.01;\r\nR=300;\r\nf=0.01;\r\ng=9.81;\r\nx=-500:50:500;\r\ny=-500:50:500;\r\n[x y]=meshgrid(x,y);\r\nvi=(g*eta0)/f*(-2*x/R^2).*exp(-(x.^2+y.^2)/R^2);\r\nui=-(g*eta0)/f*(-2*y/R^2).*exp(-(x.^2+y.^2)/R^2);\r\n[u,v]=your_fcn_name(x)\r\nassert(isequal(u,ui)\u0026isequal(v,vi))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T16:11:31.000Z","updated_at":"2025-12-08T12:29:58.000Z","published_at":"2016-10-08T16:11:31.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[eta0=0.01;\\nR=300;\\nf=0.01;\\ng=9.81;\\nx=-500:50:500;\\ny=-500:50:500;\\n[x y]=meshgrid(x,y);\\neta=eta0*exp(-(x.^2+y.^2)/R^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\u003eeta indicates sea surface height in each point (x,y). Calculate geostrophic current (u,v).\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:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Geostrophic_current\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttps://en.wikipedia.org/wiki/Geostrophic_current\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":43290,"title":"Calculate numerical integration.","description":"  x=0:0.01:1\r\n  y=@(x)x.^2\r\n\r\nUsing given two inputs(x and y), conduct numerical integration in x.\r\n\r\n(hint: trapz)","description_html":"\u003cpre class=\"language-matlab\"\u003ex=0:0.01:1\r\ny=@(x)x.^2\r\n\u003c/pre\u003e\u003cp\u003eUsing given two inputs(x and y), conduct numerical integration in x.\u003c/p\u003e\u003cp\u003e(hint: trapz)\u003c/p\u003e","function_template":"function z = integralx2(x,y)\r\n  z=\r\nend","test_suite":"%%\r\nx=0:0.01:1;\r\ny=@(x)x.^2\r\nz_correct = 0.3334\r\nassert(abs(integralx2(x,y)-z_correct)\u003c0.001)\r\n\r\n\r\n%%\r\nx=0:0.01:1;\r\ny=@(x)x.^3\r\nz_correct = 0.25\r\nassert(abs(integralx2(x,y)-z_correct)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2016-10-15T05:49:20.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T05:41:31.000Z","updated_at":"2025-11-29T14:58:18.000Z","published_at":"2016-10-10T05:41:31.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x=0:0.01:1\\ny=@(x)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\u003eUsing given two inputs(x and y), conduct numerical integration in x.\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\u003e(hint: trapz)\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":43278,"title":"Make roundn function","description":"Make roundn function using round.\r\n\r\n  x=0.55555\r\n  y=function(x,1)\r\n  y=1\r\n\r\n  y=function(x,2)\r\n  y=0.6\r\n\r\n  y=function(x,3)\r\n  y=0.56\r\n\r\n\r\n\r\n","description_html":"\u003cp\u003eMake roundn function using round.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex=0.55555\r\ny=function(x,1)\r\ny=1\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ey=function(x,2)\r\ny=0.6\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ey=function(x,3)\r\ny=0.56\r\n\u003c/pre\u003e","function_template":"function y = myroundn(x,n)\r\n  y = \r\nend","test_suite":"%%\r\nx = 0.5555;\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.5555;\r\nn = 2;\r\ny_correct = 0.6;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.5555;\r\nn = 3;\r\ny_correct = 0.56;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.1111;\r\nn = 1;\r\ny_correct = 0;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.1111;\r\nn = 2;\r\ny_correct = 0.1;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.1111;\r\nn = 3;\r\ny_correct = 0.11;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 4.2736;\r\nn = 1;\r\ny_correct = 4;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 4.2736;\r\nn = 2;\r\ny_correct = 4.3;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 4.2736;\r\nn = 3;\r\ny_correct = 4.27;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 4.2736;\r\nn = 4;\r\ny_correct = 4.274;\r\nassert(isequal(myroundn(x,n),y_correct))","published":true,"deleted":false,"likes_count":30,"comments_count":3,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4518,"test_suite_updated_at":"2016-11-22T18:46:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T12:34:11.000Z","updated_at":"2026-04-02T02:10:47.000Z","published_at":"2016-10-09T12:34:11.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\u003eMake roundn function using round.\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=0.55555\\ny=function(x,1)\\ny=1\\n\\ny=function(x,2)\\ny=0.6\\n\\ny=function(x,3)\\ny=0.56]]\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\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":43333,"title":"Save variables","description":"a=[1]\r\n\r\nSave variable a that is located in workspace into current folder. File name should be 'a.mat'","description_html":"\u003cp\u003ea=[1]\u003c/p\u003e\u003cp\u003eSave variable a that is located in workspace into current folder. File name should be 'a.mat'\u003c/p\u003e","function_template":"function y = savevar(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\nsavevar(a)\r\nii=ls('a.mat')\r\nassert(~isempty(ii))\r\n\r\n%%\r\nclear\r\nload a\r\nassert(a==1)","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2016-10-15T04:35:08.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-11T14:13:40.000Z","updated_at":"2026-02-06T12:20:54.000Z","published_at":"2016-10-11T14:13:40.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\u003ea=[1]\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\u003eSave variable a that is located in workspace into current folder. File name should be 'a.mat'\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":43156,"title":"Find x in provided equation!","description":"x^2-2*x+1=0\r\n\r\nThis polynomial can be expressed by using each term's coefficients, such as\r\n\r\n[1 -2 1].\r\n\r\nUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \"roots\")","description_html":"\u003cp\u003ex^2-2*x+1=0\u003c/p\u003e\u003cp\u003eThis polynomial can be expressed by using each term's coefficients, such as\u003c/p\u003e\u003cp\u003e[1 -2 1].\u003c/p\u003e\u003cp\u003eUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \"roots\")\u003c/p\u003e","function_template":"function y = solvepol(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 -2 1];\r\ny_correct = [1;1];\r\nassert(isequal(solvepol(x),y_correct))\r\n\r\n%%\r\nx = [1 -3 2];\r\ny_correct = [2;1];\r\nassert(isequal(solvepol(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":120,"test_suite_updated_at":"2016-10-21T06:37:13.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T13:48:30.000Z","updated_at":"2026-02-05T18:05:42.000Z","published_at":"2016-10-07T13:48: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\",\"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\u003ex^2-2*x+1=0\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 polynomial can be expressed by using each term's coefficients, such as\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\u003e[1 -2 1].\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\u003eUsing the polynomial that are expressed by coefficients, calculate solution x. (hint: use \\\"roots\\\")\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":43314,"title":"Change matrix to vector","description":"Vector is a matrix whose size is 1 x n or n x 1.\r\n\r\nChange matrix to vector.\r\n\r\n  x =\r\n  \r\n       4     3\r\n       5     1\r\n       5     1\r\n\r\ninput x should change to output y.\r\n\r\n  y =\r\n  \r\n       4\r\n       5\r\n       5\r\n       3\r\n       1\r\n       1","description_html":"\u003cp\u003eVector is a matrix whose size is 1 x n or n x 1.\u003c/p\u003e\u003cp\u003eChange matrix to vector.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex =\r\n\u003c/pre\u003e\u003cpre\u003e       4     3\r\n       5     1\r\n       5     1\u003c/pre\u003e\u003cp\u003einput x should change to output y.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey =\r\n\u003c/pre\u003e\u003cpre\u003e       4\r\n       5\r\n       5\r\n       3\r\n       1\r\n       1\u003c/pre\u003e","function_template":"function y = rearrange(x)\r\n  y =\r\nend","test_suite":"%%\r\nx = [  2     3\r\n       3     4\r\n       3     4];\r\ny_correct = [2;3;3;3;4;4];\r\nassert(isequal(rearrange(x),y_correct))\r\n\r\n%%\r\nx = [  4     3\r\n       5     1\r\n       5     1];\r\ny_correct = [4;5;5;3;1;1];\r\nassert(isequal(rearrange(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":204,"test_suite_updated_at":"2016-10-15T04:42:30.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T14:39:54.000Z","updated_at":"2026-02-11T18:22:52.000Z","published_at":"2016-10-10T14:39: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\u003eVector is a matrix whose size is 1 x n or n x 1.\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\u003eChange matrix to vector.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x =\\n\\n       4     3\\n       5     1\\n       5     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\u003einput x should change to output y.\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 =\\n\\n       4\\n       5\\n       5\\n       3\\n       1\\n       1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43552,"title":"Calculate solution of given polynomial","description":"For example,\r\n\r\ny=function([3 -2 -4])\r\n\r\nIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\r\n\r\ny=[1.5352; -0.8685]","description_html":"\u003cp\u003eFor example,\u003c/p\u003e\u003cp\u003ey=function([3 -2 -4])\u003c/p\u003e\u003cp\u003eIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\u003c/p\u003e\u003cp\u003ey=[1.5352; -0.8685]\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [3 -2 -4];\r\ny_correct = [  1.5352\r\n              -0.8685];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx = [1 2 1];\r\ny_correct = [-1;-1];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx = [1 2 2];\r\ny_correct = [  -1.0000 + 1.0000i\r\n               -1.0000 - 1.0000i];\r\nassert(abs(sum(your_fcn_name(x)-y_correct))\u003c0.001)\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":97,"test_suite_updated_at":"2016-10-15T04:16:27.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-14T11:53:24.000Z","updated_at":"2026-02-17T08:26:30.000Z","published_at":"2016-10-14T11:53:24.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\u003eFor example,\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\u003ey=function([3 -2 -4])\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\u003eIn here, input vector indicate 3*x^2-2*x-4, y is solution of former equation.\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\u003ey=[1.5352; -0.8685]\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":43308,"title":"Calculate some equation","description":"Using given inputs x and z, make two outputs that are\r\n\r\n y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\r\n\r\n y2 = x^z - z^x + (x/z)^2 - (z/x)^2\r\n\r\n","description_html":"\u003cp\u003eUsing given inputs x and z, make two outputs that are\u003c/p\u003e\u003cpre\u003e y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\u003c/pre\u003e\u003cpre\u003e y2 = x^z - z^x + (x/z)^2 - (z/x)^2\u003c/pre\u003e","function_template":"function [y1 y2] = calculate_eq(x,z)\r\n  y1 =\r\n  y2 =  \r\nend","test_suite":"%%\r\nx = 1;\r\nz = 1;\r\ny1=14.2000\r\ny2=0\r\n\r\n[y11,y22]=calculate_eq(x,z)\r\nassert( abs(y1-y11)+abs(y2-y22)\u003c0.001 )\r\n\r\n\r\n%%\r\nx = 2;\r\nz = 1;\r\ny1= 55.7000\r\ny2=4.7500\r\n\r\n[y11,y22]=calculate_eq(x,z)\r\nassert( abs(y1-y11)+abs(y2-y22)\u003c0.001 )\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":164,"test_suite_updated_at":"2016-10-15T04:52:37.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T13:09:03.000Z","updated_at":"2026-02-18T21:55:46.000Z","published_at":"2016-10-10T13:09:03.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\u003eUsing given inputs x and z, make two outputs that are\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[ y1 = (xz)/(x/z)^2 + 14x^2 - 0.8z^2\\n\\n y2 = x^z - z^x + (x/z)^2 - (z/x)^2]]\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":43488,"title":"Print true if ","description":"all elements are larger than 5\r\n\r\n  a=[1 3 5 8 6];\r\n  b=[6 6 6 6 6];\r\n\r\nfunction(a) should be false, and function(b) will be true.\r\n","description_html":"\u003cp\u003eall elements are larger than 5\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea=[1 3 5 8 6];\r\nb=[6 6 6 6 6];\r\n\u003c/pre\u003e\u003cp\u003efunction(a) should be false, and function(b) will be true.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [6 6 6 6 6 6 6 6 ];\r\ny_correct = true;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [6 6 6 1 6 6 6 6 ];\r\ny_correct = false;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [6 6 9 6 6 6 9 1 ];\r\ny_correct = false;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":153,"test_suite_updated_at":"2016-10-15T04:19:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-12T13:22:38.000Z","updated_at":"2026-02-13T15:31:15.000Z","published_at":"2016-10-12T13:22:38.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\u003eall elements are larger than 5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a=[1 3 5 8 6];\\nb=[6 6 6 6 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\u003efunction(a) should be false, and function(b) will be true.\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":43190,"title":"Determine point is located in a circle or not","description":"Using input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\r\nif point is located in circle, output is true.","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\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: 269px 8px; transform-origin: 269px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsing input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\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: 126.5px 8px; transform-origin: 126.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eif point is located in circle, output is true.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = inorout(x,y)\r\n  z=true\r\nend","test_suite":"%%\r\nx = 1;\r\ny = 2;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny = 0;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 0.5;\r\ny = 0.5;\r\ny_correct = 1;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = -1;\r\ny = -1;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 0;\r\ny = 0;\r\ny_correct = 1;\r\nassert(isequal(inorout(x,y),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny = 3;\r\ny_correct = 0;\r\nassert(isequal(inorout(x,y),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":223089,"edited_at":"2022-09-09T07:58:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2022-09-09T07:58:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T06:42:36.000Z","updated_at":"2026-02-18T10:12:49.000Z","published_at":"2016-10-08T06:42:36.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\u003eUsing input [x] and [y], determine the points (x,y) is located inside of circle (x^2+y^2=1)\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\u003eif point is located in circle, output is true.\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":43311,"title":"How to calculate log?","description":"There is a log that have base 5. How to calculate?\r\n\r\nlog5(x)?","description_html":"\u003cp\u003eThere is a log that have base 5. How to calculate?\u003c/p\u003e\u003cp\u003elog5(x)?\u003c/p\u003e","function_template":"function y = log5(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 5;\r\ny_correct = 1;\r\nassert(isequal(log5(x),y_correct))\r\n\r\n%%\r\nx = 25;\r\ny_correct = 2;\r\nassert(isequal(log5(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":11,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":189,"test_suite_updated_at":"2016-10-15T04:46:34.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T13:19:22.000Z","updated_at":"2026-02-18T11:18:10.000Z","published_at":"2016-10-10T13:19:22.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\u003eThere is a log that have base 5. How to calculate?\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\u003elog5(x)?\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":43161,"title":"Replace 0 to NaN!","description":"In given matrix\r\n\r\nA=[1 nan nan; 2 2 nan; nan nan 1];\r\n\r\nreplace NaN to 0. Use matrix A as a input.","description_html":"\u003cp\u003eIn given matrix\u003c/p\u003e\u003cp\u003eA=[1 nan nan; 2 2 nan; nan nan 1];\u003c/p\u003e\u003cp\u003ereplace NaN to 0. Use matrix A as a input.\u003c/p\u003e","function_template":"function y = nan2zero(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx=[1 nan nan; 2 2 nan; nan nan 1];\r\ny_correct = [1 0 0; 2 2 0; 0 0 1];\r\nassert(all(all(nan2zero(x)==y_correct)))\r\n\r\n%%\r\nx=[nan nan];\r\ny_correct = [0 0];\r\nassert(all(all(nan2zero(x)==y_correct)))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":105,"test_suite_updated_at":"2016-10-21T06:46:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T14:44:39.000Z","updated_at":"2026-03-09T20:55:18.000Z","published_at":"2016-10-07T14:44: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\",\"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 given 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\u003eA=[1 nan nan; 2 2 nan; nan nan 1];\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\u003ereplace NaN to 0. Use matrix A as a input.\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":43185,"title":"How to permute given 3d matrix?","description":"  A(:,:,1)=[1 3]\r\n  A(:,:,2)=[2 2]\r\n  A(:,:,3)=[4 3]\r\n\r\nChange rows to columns and columns to rows, similar to transpose.\r\nResult should be\r\n\r\n  A(:,:,1)=[1;3]\r\n  A(:,:,2)=[2;2]\r\n  A(:,:,3)=[4;3]\r\n\r\n(hint: use permute)","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: 194.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 97.3px; transform-origin: 407px 97.3px; vertical-align: baseline; \"\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; 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 30.65px; transform-origin: 404px 30.65px; 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: 56px 8.5px; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,1)=[1 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; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,2)=[2 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: 56px 8.5px; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,3)=[4 3]\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: 266.5px 8px; transform-origin: 266.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eChange rows to columns and columns to rows, similar to transpose. Result should be\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; 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 30.65px; transform-origin: 404px 30.65px; 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: 56px 8.5px; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,1)=[1;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; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,2)=[2;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: 56px 8.5px; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(:,:,3)=[4;3]\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: 60px 8px; transform-origin: 60px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(hint: use permute)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = mypermute(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nA(:,:,1) = [1,3]; A(:,:,2) = [2,2]; A(:,:,3) = [4,3];\r\nA_p(:,:,1) = [1;3]; A_p(:,:,2) = [2;2]; A_p(:,:,3) = [4;3];\r\nassert(isequal(mypermute(A),A_p))\r\n\r\n%%\r\nA(:,:,1) = [2;3]; A(:,:,2) = [3;2]; A(:,:,3) = [4;3];\r\nA_p(:,:,1) = [2,3]; A_p(:,:,2) = [3,2]; A_p(:,:,3) = [4,3];\r\nassert(isequal(mypermute(A),A_p))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2020-12-21T14:24:23.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T03:00:49.000Z","updated_at":"2026-03-11T08:28:03.000Z","published_at":"2016-10-08T03:00:49.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[A(:,:,1)=[1 3]\\nA(:,:,2)=[2 2]\\nA(:,:,3)=[4 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChange rows to columns and columns to rows, similar to transpose. Result 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[A(:,:,1)=[1;3]\\nA(:,:,2)=[2;2]\\nA(:,:,3)=[4;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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e(hint: use permute)\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":43274,"title":"Calculate correlation.","description":"There are two data.\r\n\r\n  y1=[0 1 2 3 4]'\r\n  y2=[2 3 4 5 6]'\r\n\r\nWe can see positive relationship between y1 and y2. The relationship between two data can be estimated using correlation coefficients.\r\n\r\nhttps://en.wikipedia.org/wiki/Correlation_and_dependence\r\n\r\nCalculate this between y1 and y2.\r\n\r\n","description_html":"\u003cp\u003eThere are two data.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey1=[0 1 2 3 4]'\r\ny2=[2 3 4 5 6]'\r\n\u003c/pre\u003e\u003cp\u003eWe can see positive relationship between y1 and y2. The relationship between two data can be estimated using correlation coefficients.\u003c/p\u003e\u003cp\u003ehttps://en.wikipedia.org/wiki/Correlation_and_dependence\u003c/p\u003e\u003cp\u003eCalculate this between y1 and y2.\u003c/p\u003e","function_template":"function y = mycorr(y1,y2)\r\n\r\n    y=\r\n    \r\nend","test_suite":"%%\r\ny1=[0 1 2 3 4]'\r\ny2=-[2 3 4 5 6]'\r\ny_correct = -1;\r\nassert(isequal(mycorr(y1,y2),y_correct))\r\n\r\n\r\n%%\r\ny1=[0 1 2 3 4]'\r\ny2=[2 3 4 5 6]'\r\ny_correct = 1;\r\nassert(isequal(mycorr(y1,y2),y_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":1,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":73,"test_suite_updated_at":"2016-10-15T07:49:56.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-09T10:55:01.000Z","updated_at":"2026-03-04T14:28:22.000Z","published_at":"2016-10-09T10:55:01.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\u003eThere are two data.\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[y1=[0 1 2 3 4]'\\ny2=[2 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\u003eWe can see positive relationship between y1 and y2. The relationship between two data can be estimated using correlation coefficients.\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:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Correlation_and_dependence\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttps://en.wikipedia.org/wiki/Correlation_and_dependence\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:t\u003eCalculate this between y1 and y2.\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":43183,"title":"Removing vibration!","description":"There are [y] that vary with [x] but y including small useless vibration.\r\n\r\n x=1:10\r\n y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03]\r\n\r\nRemove the vibration using moving average. processed vector yp is calculated follow these method.\r\n\r\nyp(1)=(y(1)+y(2)+y(3))/3\r\n\r\nyp(2)=(y(2)+y(3)+y(4))/3\r\n\r\nyp(3)=(y(3)+y(4)+y(5))/3 ...\r\n\r\n(hint: conv function)\r\n\r\n","description_html":"\u003cp\u003eThere are [y] that vary with [x] but y including small useless vibration.\u003c/p\u003e\u003cpre\u003e x=1:10\r\n y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03]\u003c/pre\u003e\u003cp\u003eRemove the vibration using moving average. processed vector yp is calculated follow these method.\u003c/p\u003e\u003cp\u003eyp(1)=(y(1)+y(2)+y(3))/3\u003c/p\u003e\u003cp\u003eyp(2)=(y(2)+y(3)+y(4))/3\u003c/p\u003e\u003cp\u003eyp(3)=(y(3)+y(4)+y(5))/3 ...\u003c/p\u003e\u003cp\u003e(hint: conv function)\u003c/p\u003e","function_template":"function z = mysmooth(x)\r\n x=1:10\r\n y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03]\r\n z=x\r\nend","test_suite":"%%\r\nx = [1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03];\r\ny_correct = [2.340 3.120 4.143 5.323 6.536 7.610 8.653 9.433];\r\nassert((mean(mysmooth(x)-y_correct)\u003c0.001))\r\n\r\n%%\r\nx=[1 1 1]\r\ny_correct=1\r\nassert((mean(mysmooth(x)-y_correct)\u003c0.001))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":"2016-10-25T04:24:35.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T02:31:36.000Z","updated_at":"2026-03-03T10:50:49.000Z","published_at":"2016-10-08T02:31:36.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\u003eThere are [y] that vary with [x] but y including small useless vibration.\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=1:10\\n y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.32 9.95 10.03]]]\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\u003eRemove the vibration using moving average. processed vector yp is calculated follow these method.\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\u003eyp(1)=(y(1)+y(2)+y(3))/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\u003eyp(2)=(y(2)+y(3)+y(4))/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\u003eyp(3)=(y(3)+y(4)+y(5))/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\u003e(hint: conv 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":43221,"title":"Interpolate scattered data.","description":"Most data was scattered, and there is no gird.\r\n\r\nThere are three data [c] in three different area [x,y].\r\n\r\n x=[1 3 4];\r\n y=[1 2 1];\r\n c=[2 3 5];\r\n\r\nEstimate data value in x=2.6, y=1.4 using interpolation. x,y,c are used as inputs.\r\n\r\n(hint: use griddata)\r\n","description_html":"\u003cp\u003eMost data was scattered, and there is no gird.\u003c/p\u003e\u003cp\u003eThere are three data [c] in three different area [x,y].\u003c/p\u003e\u003cpre\u003e x=[1 3 4];\r\n y=[1 2 1];\r\n c=[2 3 5];\u003c/pre\u003e\u003cp\u003eEstimate data value in x=2.6, y=1.4 using interpolation. x,y,c are used as inputs.\u003c/p\u003e\u003cp\u003e(hint: use griddata)\u003c/p\u003e","function_template":"function z = datinter(x,y,c) \r\n z=?\r\nend","test_suite":"%%\r\n x=[1 3 4];\r\n y=[1 2 1];\r\n c=[2 3 5];\r\ny_correct = griddata(x,y,c,2.6,1.4);\r\nassert(isequal(datinter(x,y,c),y_correct))\r\n\r\n%%\r\n x=[1 2 4];\r\n y=[1 2 1.2];\r\n c=[2 6 9];\r\ny_correct = griddata(x,y,c,2.6,1.4);\r\nassert(isequal(datinter(x,y,c),y_correct))\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2016-10-15T07:58:27.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-08T13:14:32.000Z","updated_at":"2026-03-05T15:57:44.000Z","published_at":"2016-10-08T13:15:37.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\u003eMost data was scattered, and there is no gird.\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\u003eThere are three data [c] in three different area [x,y].\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=[1 3 4];\\n y=[1 2 1];\\n c=[2 3 5];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEstimate data value in x=2.6, y=1.4 using interpolation. x,y,c are used as 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:t\u003e(hint: use griddata)\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":43282,"title":"Analyze observation data","description":"Suppose you have the following data (A,B,C) in three-column format.\r\n\r\n     A       B       C\r\n--------------------------\r\nt=1  2.2     2.6     2.4\r\nt=2  2.4     2.8     2.2 \r\nt=3  2.6     2.7     2.4 \r\nt=4  2.7     2.6     2.5\r\nt=5  2.6     2.5     2.6\r\nt=6  2.5     2.4     3.0\r\n\r\nWrite a function to find and return the maximum value from each column as well as its time index. For the supplied example, A has a maximum value of 2.7 when t=4, B has a maximum of 2.8 when t=2, and C has a maximum of 3.0 when t=6. Therefore, the function should output:\r\n\r\n\r\n m = [2.7 2.8 3.0]   tm = [4 2 6]","description_html":"\u003cp\u003eSuppose you have the following data (A,B,C) in three-column format.\u003c/p\u003e\u003cpre\u003e     A       B       C\r\n--------------------------\r\nt=1  2.2     2.6     2.4\r\nt=2  2.4     2.8     2.2 \r\nt=3  2.6     2.7     2.4 \r\nt=4  2.7     2.6     2.5\r\nt=5  2.6     2.5     2.6\r\nt=6  2.5     2.4     3.0\u003c/pre\u003e\u003cp\u003eWrite a function to find and return the maximum value from each column as well as its time index. For the supplied example, A has a maximum value of 2.7 when t=4, B has a maximum of 2.8 when t=2, and C has a maximum of 3.0 when t=6. Therefore, the function should output:\u003c/p\u003e\u003cpre\u003e m = [2.7 2.8 3.0]   tm = [4 2 6]\u003c/pre\u003e","function_template":"function [m,tm] = data_process(x)\r\n  m =\r\n  tm =\r\nend","test_suite":"%%\r\nx=[2.2     2.6     2.4\r\n   2.4     2.8     2.2\r\n   2.6     2.7     2.4 \r\n   2.7     2.6     2.5\r\n   2.6     2.5     2.6\r\n   2.5     2.4     3.0];\r\n\r\nmi=[2.7,2.8,3.0];\r\ntmi=[4,2,6];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n\r\n%%\r\nx=[2.2     2.6     2.4\r\n   2.4     2.8     2.2\r\n   2.6     7.7     2.4 \r\n   9.7     2.6     2.5\r\n   2.6     2.5     2.6\r\n   2.5     2.4     7.0];\r\n\r\nmi=[9.7,7.7,7.0];\r\ntmi=[4,3,6];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n\r\n%%\r\nx=[1.2     1.6     8.4\r\n   4.4     2.8     7.2\r\n   3.6     1.7     2.4 \r\n   1.1     2.4     5.5\r\n   2.3     2.6     2.6\r\n   7.4     7.4     3.0];\r\n\r\nmi=[7.4,7.4,8.4];\r\ntmi=[6,6,1];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n\r\n%%\r\nx=[2.1     6.6     3.5\r\n   4.7     8.2     4.5\r\n   6.3     7.1     2.5 \r\n   8.1     4.4     3.7\r\n   5.2     3.7     1.6\r\n   1.3     7.1     1.0];\r\n\r\nmi=[8.1,8.2,4.5];\r\ntmi=[4,2,2];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n\r\n%%\r\nx=[9.1     9.8     9.5\r\n   9.7     9.2     9.1\r\n   9.9     9.5     9.2 \r\n   9.1     9.4     9.7\r\n   9.2     9.7     9.6\r\n   9.3     9.3     9.0];\r\n\r\nmi=[9.9,9.8,9.7];\r\ntmi=[3,1,4];\r\n[m,tm]=data_process(x);\r\nassert(isequal(tm,tmi)\u0026isequal(m,mi))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":1,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":71,"test_suite_updated_at":"2016-11-22T19:02:55.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T14:34:07.000Z","updated_at":"2026-03-12T23:59:59.000Z","published_at":"2016-10-09T14:34:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose you have the following data (A,B,C) in three-column format.\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       B       C\\n--------------------------\\nt=1  2.2     2.6     2.4\\nt=2  2.4     2.8     2.2 \\nt=3  2.6     2.7     2.4 \\nt=4  2.7     2.6     2.5\\nt=5  2.6     2.5     2.6\\nt=6  2.5     2.4     3.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\u003eWrite a function to find and return the maximum value from each column as well as its time index. For the supplied example, A has a maximum value of 2.7 when t=4, B has a maximum of 2.8 when t=2, and C has a maximum of 3.0 when t=6. Therefore, the function should 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[ m = [2.7 2.8 3.0]   tm = [4 2 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":43279,"title":"Weighted moving average","description":"x1=[1 2 1];\r\ny1=[1 2 2 4 5 6 6 8];\r\n\r\nMake function for weighted moving average.\r\n\r\nz(i)=(x1(i)*y1(i)+x1(i+1)*y1(i+1)+x1(i+2)*y1(i+2))/3\r\n\r\nAs a result,\r\n\r\n  z =\r\n\r\n    2.3333    3.3333    5.0000    6.6667    7.6667    8.6667\r\n","description_html":"\u003cp\u003ex1=[1 2 1];\r\ny1=[1 2 2 4 5 6 6 8];\u003c/p\u003e\u003cp\u003eMake function for weighted moving average.\u003c/p\u003e\u003cp\u003ez(i)=(x1(i)*y1(i)+x1(i+1)*y1(i+1)+x1(i+2)*y1(i+2))/3\u003c/p\u003e\u003cp\u003eAs a result,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ez =\r\n\u003c/pre\u003e\u003cpre\u003e    2.3333    3.3333    5.0000    6.6667    7.6667    8.6667\u003c/pre\u003e","function_template":"function z = smooth1dconv(x1,y1)\r\n  z = \r\nend","test_suite":"%%\r\nx1=[1 2 1]; y1=[1 2 2 4 5 6 6 8];\r\ny_correct = [2.3333    3.3333    5.0000    6.6667    7.6667    8.6667];\r\nassert(sum(abs(smooth1dconv(x1,y1)-y_correct))\u003c0.001)\r\n\r\n%%\r\nx1=[1 2 1]; y1=[1 1 1 1 1 1 1 1];\r\ny_correct = [1.3333    1.3333    1.3333    1.3333    1.3333    1.3333];\r\nassert(sum(abs(smooth1dconv(x1,y1)-y_correct))\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2016-10-15T07:46:37.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T12:41:13.000Z","updated_at":"2026-03-28T21:10:37.000Z","published_at":"2016-10-09T12:41: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\u003ex1=[1 2 1]; y1=[1 2 2 4 5 6 6 8];\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\u003eMake function for weighted moving average.\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\u003ez(i)=(x1(i)*y1(i)+x1(i+1)*y1(i+1)+x1(i+2)*y1(i+2))/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\u003eAs a result,\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[z =\\n\\n    2.3333    3.3333    5.0000    6.6667    7.6667    8.6667]]\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":43285,"title":"Solve equation numerically","description":"\r\ny'=y\r\n\r\nIn order to solve equation using computer, numerical analysis are needed. 1st order Euler's method is one of the method. above equation can be expressed as\r\n\r\ny(i+1)=y(i)+h*y(i) \r\n\r\ny(1)=1\r\n\r\nCalculate y(10) using h=0.1. Inputs are y(1) and h.\r\n\r\nhttps://en.wikipedia.org/wiki/Euler_method\r\n","description_html":"\u003cp\u003ey'=y\u003c/p\u003e\u003cp\u003eIn order to solve equation using computer, numerical analysis are needed. 1st order Euler's method is one of the method. above equation can be expressed as\u003c/p\u003e\u003cp\u003ey(i+1)=y(i)+h*y(i)\u003c/p\u003e\u003cp\u003ey(1)=1\u003c/p\u003e\u003cp\u003eCalculate y(10) using h=0.1. Inputs are y(1) and h.\u003c/p\u003e\u003cp\u003ehttps://en.wikipedia.org/wiki/Euler_method\u003c/p\u003e","function_template":"function z = e1solver(h,y1)\r\n    y(1)=y1\r\n    \r\n    z =\r\nend","test_suite":"%%\r\nh=0.1\r\ny1=1\r\ny_correct = 2.3579;\r\nassert(abs(e1solver(h,y1)-y_correct)\u003c0.01)\r\n\r\n%%\r\nclc\r\nclear\r\nh=0.1\r\ny1=2\r\ny_correct = 4.7159;\r\nassert(abs(e1solver(h,y1)-y_correct)\u003c0.01)\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2016-10-15T06:09:33.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-09T16:57:45.000Z","updated_at":"2026-03-11T13:42:36.000Z","published_at":"2016-10-09T16:59:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003ey'=y\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\u003eIn order to solve equation using computer, numerical analysis are needed. 1st order Euler's method is one of the method. above equation can be expressed as\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\u003ey(i+1)=y(i)+h*y(i)\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\u003ey(1)=1\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\u003eCalculate y(10) using h=0.1. Inputs are y(1) and h.\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\u003ehttps://en.wikipedia.org/wiki/Euler_method\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":43315,"title":"Change matrix to vector2","description":"From \r\n\r\n  x =\r\n  \r\n       4     3\r\n       5     1\r\n       5     1\r\n\r\nTo\r\n\r\n  y =\r\n  \r\n       4\r\n       3\r\n       5\r\n       1\r\n       5\r\n       1","description_html":"\u003cp\u003eFrom\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex =\r\n\u003c/pre\u003e\u003cpre\u003e       4     3\r\n       5     1\r\n       5     1\u003c/pre\u003e\u003cp\u003eTo\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey =\r\n\u003c/pre\u003e\u003cpre\u003e       4\r\n       3\r\n       5\r\n       1\r\n       5\r\n       1\u003c/pre\u003e","function_template":"function y = rearrange2(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [  4     3\r\n       5     1\r\n       5     1];\r\ny_correct = [4;3;5;1;5;1];\r\nassert(isequal(rearrange2(x),y_correct))\r\n\r\n%%\r\nx = [  2     4\r\n       1     4\r\n       1     2];\r\ny_correct = [2;4;1;4;1;2];\r\nassert(isequal(rearrange2(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":118,"test_suite_updated_at":"2016-10-15T04:41:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T14:41:56.000Z","updated_at":"2026-03-16T11:04:24.000Z","published_at":"2016-10-10T14:41:56.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\u003eFrom\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 =\\n\\n       4     3\\n       5     1\\n       5     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\u003eTo\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 =\\n\\n       4\\n       3\\n       5\\n       1\\n       5\\n       1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43281,"title":"Two dimensional moving average","description":" A=[1 2 3 4 5\r\n    1 2 2 2 3\r\n    2 3 3 3 4\r\n    1 1 4 4 2]\r\n\r\n B=[1 1;1 1]; % This is can be used for weight factor of moving average\r\n\r\nCalculate two dimensional moving averaged matrix of A\r\n\r\ny(i,j)=A(i,j)*B(1,1)+A(i+1,j)*B(2,1)+A(i,j+1)*B(1,2)+A(i+1,j+1)*B(2,2)\r\n\r\nAs a result,\r\n\r\n  ans =\r\n\r\n    1.5000    2.2500    2.7500    3.5000\r\n    2.0000    2.5000    2.5000    3.0000\r\n    1.7500    2.7500    3.5000    3.2500","description_html":"\u003cpre\u003e A=[1 2 3 4 5\r\n    1 2 2 2 3\r\n    2 3 3 3 4\r\n    1 1 4 4 2]\u003c/pre\u003e\u003cpre\u003e B=[1 1;1 1]; % This is can be used for weight factor of moving average\u003c/pre\u003e\u003cp\u003eCalculate two dimensional moving averaged matrix of A\u003c/p\u003e\u003cp\u003ey(i,j)=A(i,j)*B(1,1)+A(i+1,j)*B(2,1)+A(i,j+1)*B(1,2)+A(i+1,j+1)*B(2,2)\u003c/p\u003e\u003cp\u003eAs a result,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eans =\r\n\u003c/pre\u003e\u003cpre\u003e    1.5000    2.2500    2.7500    3.5000\r\n    2.0000    2.5000    2.5000    3.0000\r\n    1.7500    2.7500    3.5000    3.2500\u003c/pre\u003e","function_template":"function y = smooth2dconv(A,B)\r\n  y = \r\nend","test_suite":"%%\r\nA=[1 2 3 4 5\r\n   1 2 2 2 3\r\n   2 3 3 3 4\r\n   1 1 4 4 2];\r\nB=[1 1;1 1];\r\ny_correct = [    1.5000    2.2500    2.7500    3.5000\r\n                 2.0000    2.5000    2.5000    3.0000\r\n                 1.7500    2.7500    3.5000    3.2500]\r\nassert(isequal(smooth2dconv(A,B),y_correct))\r\n\r\n%%\r\nA=[1 1 3 4\r\n   1 2 1 2\r\n   2 3 3 1\r\n   1 1 4 4];\r\nB=[1 2;2 1];\r\ny_correct = [       1.7500    3.0000    3.7500\r\n                    3.0000    3.2500    3.0000\r\n                    2.7500    3.7500    4.2500]\r\nassert(isequal(smooth2dconv(A,B),y_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":46,"test_suite_updated_at":"2016-10-15T07:36:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T13:35:27.000Z","updated_at":"2025-11-30T18:28:47.000Z","published_at":"2016-10-09T13:35: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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ A=[1 2 3 4 5\\n    1 2 2 2 3\\n    2 3 3 3 4\\n    1 1 4 4 2]\\n\\n B=[1 1;1 1]; % This is can be used for weight factor of moving average]]\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\u003eCalculate two dimensional moving averaged matrix 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\u003ey(i,j)=A(i,j)*B(1,1)+A(i+1,j)*B(2,1)+A(i,j+1)*B(1,2)+A(i+1,j+1)*B(2,2)\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\u003eAs a result,\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[ans =\\n\\n    1.5000    2.2500    2.7500    3.5000\\n    2.0000    2.5000    2.5000    3.0000\\n    1.7500    2.7500    3.5000    3.2500]]\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":43177,"title":"Extract a specific part of matrix!","description":"In the given matrix, extract element that have odd rows and column number.\r\n\r\nFor example\r\n\r\n  A=[1 4 2 3 5]\r\n  B=extractodd(A);\r\n\r\nB should be\r\n\r\n  [1 2 5]\r\n\r\nAnd, if A is\r\n\r\n  [1 2 3\r\n   4 5 6\r\n   7 8 9]\r\n\r\nB should be\r\n\r\n  [1 3\r\n   7 9]","description_html":"\u003cp\u003eIn the given matrix, extract element that have odd rows and column number.\u003c/p\u003e\u003cp\u003eFor example\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA=[1 4 2 3 5]\r\nB=extractodd(A);\r\n\u003c/pre\u003e\u003cp\u003eB should be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1 2 5]\r\n\u003c/pre\u003e\u003cp\u003eAnd, if A is\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1 2 3\r\n 4 5 6\r\n 7 8 9]\r\n\u003c/pre\u003e\u003cp\u003eB should be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[1 3\r\n 7 9]\r\n\u003c/pre\u003e","function_template":"function y = extractodd(x)\r\n    y=\r\nend","test_suite":"%%\r\n  x=[1 2 3;\r\n     4 5 6;\r\n     7 8 9]\r\ny_correct = [1 3;7 9]\r\nassert(isequal(extractodd(x),y_correct))\r\n\r\n%%\r\n  x=[1 3 5 7 9]\r\ny_correct = [1 5 9]\r\nassert(isequal(extractodd(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":83,"test_suite_updated_at":"2016-10-25T04:38:05.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T18:38:10.000Z","updated_at":"2026-03-23T04:56:58.000Z","published_at":"2016-10-07T18:38:10.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\u003eIn the given matrix, extract element that have odd rows and column number.\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\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 4 2 3 5]\\nB=extractodd(A);]]\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\u003eB 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 2 5]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAnd, if 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[[1 2 3\\n 4 5 6\\n 7 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\u003eB 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 3\\n 7 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":43298,"title":"Calculate area of sector","description":"A=function(r,seta)\r\n\r\nr is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2)*seta;","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eA=function(r,seta)\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003er(m) is radius of sector, seta (radian) is angle of sector, and A (m^2) is its area.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = sectorarea(r,seta)\r\n  y =\r\nend","test_suite":"%%\r\nr=1\r\nseta=pi/2\r\ny_correct = 0.7854;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n\r\n%%\r\nr=2\r\nseta=pi/2\r\ny_correct = pi;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n\r\n%%\r\nr=sqrt(2);\r\nseta=pi/3\r\ny_correct = pi/3;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n\r\n%%\r\nr= 6\r\nseta=pi/6;\r\ny_correct = 3*pi;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n\r\n%%\r\nr= pi\r\nseta= pi\r\ny_correct = 0.5*pi^3;\r\nassert(abs(sectorarea(r,seta)-y_correct)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":21,"comments_count":6,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":3452,"test_suite_updated_at":"2021-02-21T07:46:40.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T09:02:12.000Z","updated_at":"2026-04-03T16:02:03.000Z","published_at":"2016-10-10T09:02:12.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\u003eA=function(r,seta)\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\u003er(m) is radius of sector, seta (radian) is angle of sector, and A (m^2) is its area.\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":43193,"title":"Where is 1?","description":"There is a 3d matrix [A] that consist of many zeros and only one.\r\nA=zeros(100,100,100);\r\ni=randi(100);\r\nj=randi(100);\r\nk=randi(100);\r\nA(i,j,k)=1;\r\nWhere is one? Find [i j k].","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: 164.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 82.0833px; transform-origin: 407px 82.0833px; vertical-align: baseline; \"\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: 202px 8px; transform-origin: 202px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThere is a 3d matrix [A] that consist of many zeros and only one.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; 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 51.0833px; transform-origin: 404px 51.0833px; 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: 84px 8.5px; tab-size: 4; transform-origin: 84px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA=zeros(100,100,100);\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: 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; \"\u003ei=randi(100);\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: 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; \"\u003ej=randi(100);\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: 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; \"\u003ek=randi(100);\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: 44px 8.5px; tab-size: 4; transform-origin: 44px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eA(i,j,k)=1;\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: 80.5px 8px; transform-origin: 80.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWhere is one? Find [i j k].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [i,j,k] = find1number(A)\r\n  i=\r\n  j=\r\n  k=\r\nend","test_suite":"%%\r\nA=zeros(100,100,100);\r\ni=randi(100);\r\nj=randi(100);\r\nk=randi(100);\r\nA(i,j,k)=1;\r\ny=find1number(A)\r\nassert(isequal(y,[i,j,k]))\r\n\r\n%%\r\nA=zeros(100,100,100);\r\ni=randi(100);\r\nj=randi(100);\r\nk=randi(100);\r\nA(i,j,k)=1;\r\ny=find1number(A)\r\nassert(isequal(y,[i,j,k]))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":33533,"edited_by":223089,"edited_at":"2023-01-09T11:23:12.000Z","deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2016-10-15T07:59:42.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T07:59:14.000Z","updated_at":"2025-12-07T21:00:07.000Z","published_at":"2016-10-08T07:59:14.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\u003eThere is a 3d matrix [A] that consist of many zeros and only one.\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=zeros(100,100,100);\\ni=randi(100);\\nj=randi(100);\\nk=randi(100);\\nA(i,j,k)=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\u003eWhere is one? Find [i j k].\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":43301,"title":"Calculate inverse matrix in m by n matrix ","description":"  x=(1:10)'\r\n  y=roundn(2*x+7*rand(size(x)),-1)\r\n\r\na*x=y\r\n\r\nEstimate a using inverse matrix calculation. This is principle of linear regression.","description_html":"\u003cpre class=\"language-matlab\"\u003ex=(1:10)'\r\ny=roundn(2*x+7*rand(size(x)),-1)\r\n\u003c/pre\u003e\u003cp\u003ea*x=y\u003c/p\u003e\u003cp\u003eEstimate a using inverse matrix calculation. This is principle of linear regression.\u003c/p\u003e","function_template":"function a = reginv(x,y)\r\n  a =\r\nend","test_suite":"%%\r\n  x=(1:10)'\r\n  y=3*x\r\n  a=3\r\n\r\nassert(abs(reginv(x,y)-a)\u003c0.001)\r\n\r\n%%\r\n  x=(1:10)'\r\n  y=3*x+2\r\n  a=3.2857\r\n\r\nassert(abs(reginv(x,y)-a)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":"2018-07-19T15:35:54.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T09:36:59.000Z","updated_at":"2026-01-02T15:53:13.000Z","published_at":"2016-10-10T09:36:59.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x=(1:10)'\\ny=roundn(2*x+7*rand(size(x)),-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\u003ea*x=y\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\u003eEstimate a using inverse matrix calculation. This is principle of linear regression.\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":43334,"title":"Solve the system of linear equations","description":"  4x - 2y  +6z=8\r\n  \r\n  2x + 8y  +2z=4\r\n  \r\n  6x + 10y +3z=0\r\n\r\nInput is each coefficient of polynomial. For example,\r\n\r\n  a=[4 -2 6 8;2 8 2 4;6 10 3 0]\r\n\r\nFind x,y,z. Output should be\r\n\r\n b=[x;y;z]\r\n\r\n","description_html":"\u003cpre class=\"language-matlab\"\u003e4x - 2y  +6z=8\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e2x + 8y  +2z=4\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e6x + 10y +3z=0\r\n\u003c/pre\u003e\u003cp\u003eInput is each coefficient of polynomial. For example,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea=[4 -2 6 8;2 8 2 4;6 10 3 0]\r\n\u003c/pre\u003e\u003cp\u003eFind x,y,z. Output should be\u003c/p\u003e\u003cpre\u003e b=[x;y;z]\u003c/pre\u003e","function_template":"function b = solvepol(a)\r\n  b=\r\nend","test_suite":"%%\r\nx=[4 -2 6 8;2 8 2 4;6 10 3 0];\r\ny_correct = [   -1.8049\r\n                 0.2927\r\n                 2.6341];\r\nassert(abs(sum(solvepol(x)-y_correct))\u003c0.01)\r\n\r\n%%\r\nx=[     9    10     3    10\r\n       10     7     6     2\r\n        2     1    10    10];\r\ny_correct = [ -2.6456\r\n               3.0127\r\n               1.2278];\r\nassert(abs(sum(solvepol(x)-y_correct))\u003c0.01)\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":107,"test_suite_updated_at":"2016-10-15T04:33:08.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-11T14:18:34.000Z","updated_at":"2026-04-01T07:49:35.000Z","published_at":"2016-10-11T14:18:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[4x - 2y  +6z=8\\n\\n2x + 8y  +2z=4\\n\\n6x + 10y +3z=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\u003eInput is each coefficient of polynomial. For example,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a=[4 -2 6 8;2 8 2 4;6 10 3 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\u003eFind x,y,z. 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[ b=[x;y;z]]]\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":43235,"title":"Calculate geostrophic current","description":"  eta0=0.01;\r\n  R=300;\r\n  f=0.01;\r\n  g=9.81;\r\n  x=-500:50:500;\r\n  y=-500:50:500;\r\n  [x y]=meshgrid(x,y);\r\n  eta=eta0*exp(-(x.^2+y.^2)/R^2);\r\n\r\neta indicates sea surface height in each point (x,y). Calculate geostrophic current (u,v).\r\n\r\nhttps://en.wikipedia.org/wiki/Geostrophic_current\r\n","description_html":"\u003cpre class=\"language-matlab\"\u003eeta0=0.01;\r\nR=300;\r\nf=0.01;\r\ng=9.81;\r\nx=-500:50:500;\r\ny=-500:50:500;\r\n[x y]=meshgrid(x,y);\r\neta=eta0*exp(-(x.^2+y.^2)/R^2);\r\n\u003c/pre\u003e\u003cp\u003eeta indicates sea surface height in each point (x,y). Calculate geostrophic current (u,v).\u003c/p\u003e\u003cp\u003ehttps://en.wikipedia.org/wiki/Geostrophic_current\u003c/p\u003e","function_template":"function [u,v] = your_fcn_name(x)\r\n  eta0=0.01;\r\n  R=300;\r\n  f=0.01;\r\n  g=9.81;\r\n  x=-500:50:500;\r\n  y=-500:50:500;\r\n  [x y]=meshgrid(x,y);\r\n  eta=eta0*exp(-(x.^2+y.^2)/R^2);\r\n  \r\n  u=\r\n  v=\r\n  \r\nend","test_suite":"%%\r\nx = 1;\r\neta0=0.01;\r\nR=300;\r\nf=0.01;\r\ng=9.81;\r\nx=-500:50:500;\r\ny=-500:50:500;\r\n[x y]=meshgrid(x,y);\r\nvi=(g*eta0)/f*(-2*x/R^2).*exp(-(x.^2+y.^2)/R^2);\r\nui=-(g*eta0)/f*(-2*y/R^2).*exp(-(x.^2+y.^2)/R^2);\r\n[u,v]=your_fcn_name(x)\r\nassert(isequal(u,ui)\u0026isequal(v,vi))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T16:11:31.000Z","updated_at":"2025-12-08T12:29:58.000Z","published_at":"2016-10-08T16:11:31.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[eta0=0.01;\\nR=300;\\nf=0.01;\\ng=9.81;\\nx=-500:50:500;\\ny=-500:50:500;\\n[x y]=meshgrid(x,y);\\neta=eta0*exp(-(x.^2+y.^2)/R^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\u003eeta indicates sea surface height in each point (x,y). Calculate geostrophic current (u,v).\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:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Geostrophic_current\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttps://en.wikipedia.org/wiki/Geostrophic_current\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":43290,"title":"Calculate numerical integration.","description":"  x=0:0.01:1\r\n  y=@(x)x.^2\r\n\r\nUsing given two inputs(x and y), conduct numerical integration in x.\r\n\r\n(hint: trapz)","description_html":"\u003cpre class=\"language-matlab\"\u003ex=0:0.01:1\r\ny=@(x)x.^2\r\n\u003c/pre\u003e\u003cp\u003eUsing given two inputs(x and y), conduct numerical integration in x.\u003c/p\u003e\u003cp\u003e(hint: trapz)\u003c/p\u003e","function_template":"function z = integralx2(x,y)\r\n  z=\r\nend","test_suite":"%%\r\nx=0:0.01:1;\r\ny=@(x)x.^2\r\nz_correct = 0.3334\r\nassert(abs(integralx2(x,y)-z_correct)\u003c0.001)\r\n\r\n\r\n%%\r\nx=0:0.01:1;\r\ny=@(x)x.^3\r\nz_correct = 0.25\r\nassert(abs(integralx2(x,y)-z_correct)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2016-10-15T05:49:20.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-10-10T05:41:31.000Z","updated_at":"2025-11-29T14:58:18.000Z","published_at":"2016-10-10T05:41:31.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x=0:0.01:1\\ny=@(x)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\u003eUsing given two inputs(x and y), conduct numerical integration in x.\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\u003e(hint: trapz)\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":43278,"title":"Make roundn function","description":"Make roundn function using round.\r\n\r\n  x=0.55555\r\n  y=function(x,1)\r\n  y=1\r\n\r\n  y=function(x,2)\r\n  y=0.6\r\n\r\n  y=function(x,3)\r\n  y=0.56\r\n\r\n\r\n\r\n","description_html":"\u003cp\u003eMake roundn function using round.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex=0.55555\r\ny=function(x,1)\r\ny=1\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ey=function(x,2)\r\ny=0.6\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ey=function(x,3)\r\ny=0.56\r\n\u003c/pre\u003e","function_template":"function y = myroundn(x,n)\r\n  y = \r\nend","test_suite":"%%\r\nx = 0.5555;\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.5555;\r\nn = 2;\r\ny_correct = 0.6;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.5555;\r\nn = 3;\r\ny_correct = 0.56;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.1111;\r\nn = 1;\r\ny_correct = 0;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.1111;\r\nn = 2;\r\ny_correct = 0.1;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 0.1111;\r\nn = 3;\r\ny_correct = 0.11;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 4.2736;\r\nn = 1;\r\ny_correct = 4;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 4.2736;\r\nn = 2;\r\ny_correct = 4.3;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 4.2736;\r\nn = 3;\r\ny_correct = 4.27;\r\nassert(isequal(myroundn(x,n),y_correct))\r\n\r\n%%\r\nx = 4.2736;\r\nn = 4;\r\ny_correct = 4.274;\r\nassert(isequal(myroundn(x,n),y_correct))","published":true,"deleted":false,"likes_count":30,"comments_count":3,"created_by":33533,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4518,"test_suite_updated_at":"2016-11-22T18:46:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T12:34:11.000Z","updated_at":"2026-04-02T02:10:47.000Z","published_at":"2016-10-09T12:34:11.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\u003eMake roundn function using round.\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=0.55555\\ny=function(x,1)\\ny=1\\n\\ny=function(x,2)\\ny=0.6\\n\\ny=function(x,3)\\ny=0.56]]\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\"}]}"}],"term":"tag:\"koaa\"","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":"tag:\"koaa\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"koaa\"","","\"","koaa","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f10132f00b0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f10132f0010\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f101330f6e0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f10132f0330\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f10132f0290\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f10132f01f0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f10132f0150\u003e":"tag:\"koaa\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f10132f0150\u003e":"tag:\"koaa\""},"queried_facets":{}},"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":"search","password":"J3bGPZzQ7asjJcCk","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":"tag:\"koaa\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"koaa\"","","\"","koaa","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f10132f00b0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f10132f0010\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f101330f6e0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f10132f0330\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f10132f0290\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f10132f01f0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f10132f0150\u003e":"tag:\"koaa\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f10132f0150\u003e":"tag:\"koaa\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":43333,"difficulty_rating":"easy"},{"id":43156,"difficulty_rating":"easy"},{"id":43314,"difficulty_rating":"easy"},{"id":43552,"difficulty_rating":"easy"},{"id":43308,"difficulty_rating":"easy"},{"id":43488,"difficulty_rating":"easy"},{"id":43190,"difficulty_rating":"easy"},{"id":43311,"difficulty_rating":"easy"},{"id":43161,"difficulty_rating":"easy"},{"id":43185,"difficulty_rating":"easy"},{"id":43274,"difficulty_rating":"easy"},{"id":43183,"difficulty_rating":"easy"},{"id":43221,"difficulty_rating":"easy"},{"id":43282,"difficulty_rating":"easy"},{"id":43279,"difficulty_rating":"easy"},{"id":43285,"difficulty_rating":"easy"},{"id":43315,"difficulty_rating":"easy"},{"id":43281,"difficulty_rating":"easy"},{"id":43177,"difficulty_rating":"easy"},{"id":43298,"difficulty_rating":"easy-medium"},{"id":43193,"difficulty_rating":"easy-medium"},{"id":43301,"difficulty_rating":"easy-medium"},{"id":43334,"difficulty_rating":"easy-medium"},{"id":43235,"difficulty_rating":"easy-medium"},{"id":43290,"difficulty_rating":"easy-medium"},{"id":43278,"difficulty_rating":"easy-medium"}]}}