{"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":42524,"title":"Xor of matrix","description":"you have to set exclusive OR of two arrays","description_html":"\u003cp\u003eyou have to set exclusive OR of two arrays\u003c/p\u003e","function_template":"function y = array_xor(a,b)\r\ny = enter your code\r\nend","test_suite":"%%\r\na=[1 2 5];\r\nb=[6 4 3];\r\ny_correct = [1   2   3   4   5   6];\r\nassert(isequal(array_xor(a,b),y_correct))\r\n%%\r\na=[1 2 5 4];\r\nb=[8 6 9 2];\r\ny_correct = [1   4   5   6   8   9];\r\nassert(isequal(array_xor(a,b),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":61,"test_suite_updated_at":"2015-08-24T06:22:20.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-20T12:48:44.000Z","updated_at":"2026-02-15T10:40:05.000Z","published_at":"2015-08-20T12:52:25.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eyou have to set exclusive OR of two arrays\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":42532,"title":"Find minimum and maximum elements of an array","description":"For a given array find minimum and maximum elements of an array and store minimum value in first index of output and maximum in 2nd.","description_html":"\u003cp\u003eFor a given array find minimum and maximum elements of an array and store minimum value in first index of output and maximum in 2nd.\u003c/p\u003e","function_template":"function y = min_max(a)\r\n%  y = google\r\nend","test_suite":"%%\r\na = [12 78 5 23 09 67 82 18];\r\ny_correct = [5 82];\r\nassert(isequal(min_max(a),y_correct))\r\n%%\r\na = [12 178 15 23 09 67 82 18];\r\ny_correct = [09 178];\r\nassert(isequal(min_max(a),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":146,"test_suite_updated_at":"2015-08-24T08:47:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T08:45:34.000Z","updated_at":"2026-03-22T09:11:20.000Z","published_at":"2015-08-24T08:45: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\",\"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 a given array find minimum and maximum elements of an array and store minimum value in first index of output and maximum in 2nd.\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":2353,"title":"Sum of the Matrix Elements","description":"Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\r\n\r\nExample : \r\n\r\nx=  [ 8     1     6]\r\n     \r\n \r\nThe total sum of the elements will be 8+1+6= 15.\r\n","description_html":"\u003cp\u003eAdd up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\u003c/p\u003e\u003cp\u003eExample :\u003c/p\u003e\u003cp\u003ex=  [ 8     1     6]\u003c/p\u003e\u003cp\u003eThe total sum of the elements will be 8+1+6= 15.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1];\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":2,"created_by":27280,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":601,"test_suite_updated_at":"2014-06-08T12:50:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-08T12:46:47.000Z","updated_at":"2026-02-05T19:39:47.000Z","published_at":"2014-06-08T12:50: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\u003eAdd up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\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\u003eExample :\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex= [ 8 1 6]\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\u003eThe total sum of the elements will be 8+1+6= 15.\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":42582,"title":"Output a vector which is table of 9","description":"Output a vector which is table of 9","description_html":"\u003cp\u003eOutput a vector which is table of 9\u003c/p\u003e","function_template":"function y = tab9()\r\n% y = multiple(9);\r\nend","test_suite":"%%\r\ny_correct = [0 9 18 27 36 45 54 63 72 81 90];\r\nassert(isequal(tab9(),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":179,"test_suite_updated_at":"2015-08-28T11:31:12.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-28T11:28:37.000Z","updated_at":"2026-02-19T14:25:41.000Z","published_at":"2015-08-28T11:31: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\u003eOutput a vector which is table of 9\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":2387,"title":"Are you in XY plane?","description":"Take a point P as an input position Vector (x,y,z). If you are in XY plane, return 1 as an output otherwise return 0.\r\n\r\nExample-\r\n\r\n1.x=[3 4 5]\r\n  y=0\r\n\r\n2.x=[3 4 0]\r\n  y=1","description_html":"\u003cp\u003eTake a point P as an input position Vector (x,y,z). If you are in XY plane, return 1 as an output otherwise return 0.\u003c/p\u003e\u003cp\u003eExample-\u003c/p\u003e\u003cp\u003e1.x=[3 4 5]\r\n  y=0\u003c/p\u003e\u003cp\u003e2.x=[3 4 0]\r\n  y=1\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx =[3 4 5];\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [3 4 0];\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":27280,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":185,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-25T05:18:28.000Z","updated_at":"2026-02-12T15:34:44.000Z","published_at":"2014-06-25T05:19:08.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\u003eTake a point P as an input position Vector (x,y,z). If you are in XY plane, return 1 as an output otherwise return 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\u003eExample-\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1.x=[3 4 5] y=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\u003e2.x=[3 4 0] y=1\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":42516,"title":"Calculate Simple Intrest for given data","description":"P,N,R stands for Principle amount, No. of years and rate of intrest resp. Calculate intrest I","description_html":"\u003cp\u003eP,N,R stands for Principle amount, No. of years and rate of intrest resp. Calculate intrest I\u003c/p\u003e","function_template":"function I = SI(p,n,r)\r\n  I = p*n*r;\r\nend","test_suite":"%%\r\np = 1000;\r\nn=2;\r\nr=8;\r\ny_correct = 160;\r\nassert(isequal(SI(p,n,r),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":83,"test_suite_updated_at":"2015-08-19T12:44:01.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-08-19T12:37:41.000Z","updated_at":"2026-02-16T11:49:15.000Z","published_at":"2015-08-19T12:38:45.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\u003eP,N,R stands for Principle amount, No. of years and rate of intrest resp. Calculate intrest I\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":42511,"title":"calculate Compound Intrest","description":"Calculate Compound Intrest for given data","description_html":"\u003cp\u003eCalculate Compound Intrest for given data\u003c/p\u003e","function_template":"function y = your_fcn_name(p,R,n)\r\n  y = \r\nend","test_suite":"%%\r\np= 100;\r\nR=10\r\nn=1\r\ny_correct = 110;\r\nassert(isequal(your_fcn_name(p,R,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":93,"test_suite_updated_at":"2015-08-18T10:21:05.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-18T10:17:15.000Z","updated_at":"2026-02-11T14:31:58.000Z","published_at":"2015-08-18T10:17: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\",\"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\u003eCalculate Compound Intrest for given data\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":44664,"title":"function to compute root mean square of first nn positive odd integers","description":"Write a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.","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: 84px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 42px; transform-origin: 407px 42px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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 42px; text-align: left; transform-origin: 384px 42px; 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: 367px 8px; transform-origin: 367px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function orms = odd_rms(nn)\r\n  \r\nend","test_suite":"%%\r\nnn = 3;\r\norms_correct = 3.4156\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)\r\n\r\n%%\r\nnn = 10;\r\norms_correct = 11.5325\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)\r\n\r\n%%\r\nnn = 1;\r\norms_correct = 1\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2021-12-31T17:41:47.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T15:13:46.000Z","updated_at":"2026-02-17T08:34:38.000Z","published_at":"2018-05-29T15:13:46.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\u003eWrite a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.\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":42706,"title":"Step up","description":"For given input array, output a array with all elements step up by two","description_html":"\u003cp\u003eFor given input array, output a array with all elements step up by two\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n%guess\r\nend","test_suite":"%%\r\nx = [1 8 9 2];\r\ny_correct = [3 10 11 4];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 11 19 21];\r\ny_correct = [3 13 21 23];\r\nassert(isequal(your_fcn_name(x),y_correct))%%\r\nx = [30 63 12 2];\r\ny_correct = [32 65 14 4];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":106,"test_suite_updated_at":"2016-01-07T13:55:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-01-07T13:51:19.000Z","updated_at":"2026-02-10T18:42:11.000Z","published_at":"2016-01-07T13:55:09.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 given input array, output a array with all elements step up by two\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":42585,"title":"Permutations of input vector","description":"Find and output all permutations of given vector","description_html":"\u003cp\u003eFind and output all permutations of given vector\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 1];\r\ny_correct = [1 1; 1 1];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 4];\r\ny_correct = [4 1; 1 4];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":81,"test_suite_updated_at":"2015-09-02T13:08:46.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-02T13:04:03.000Z","updated_at":"2026-02-20T13:52:24.000Z","published_at":"2015-09-02T13:08:46.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eFind and output all permutations of given vector\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":42536,"title":"Rotate a matrix for 180 degree","description":"Rotate a matrix for 180 degree\r\nfor eg: x=[1 2 3 4]\r\n        y=[4   3   2   1]","description_html":"\u003cp\u003eRotate a matrix for 180 degree\r\nfor eg: x=[1 2 3 4]\r\n        y=[4   3   2   1]\u003c/p\u003e","function_template":"function y = rot(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2 3 4];\r\ny_correct = [4 3 2 1];\r\nassert(isequal(rot(x),y_correct))\r\n\r\n%%\r\nx = [5 6 7 8];\r\ny_correct = [8 7 6 5];\r\nassert(isequal(rot(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":187,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T09:14:06.000Z","updated_at":"2026-02-16T12:21:36.000Z","published_at":"2015-08-24T09:14:06.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\u003eRotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]\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":42534,"title":"find whether it is prime or not","description":"For a given number find if its prime","description_html":"\u003cp\u003eFor a given number find if its prime\u003c/p\u003e","function_template":"function y = prime(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 22;\r\ny_correct = 0;\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 22;\r\ny_correct = 0;\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 21;\r\ny_correct = 0;\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 5;\r\ny_correct = 1;\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 3;\r\ny_correct = 1;\r\nassert(isequal(prime(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":157,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T09:05:06.000Z","updated_at":"2026-02-09T16:39:49.000Z","published_at":"2015-08-24T09:05:06.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 a given number find if its prime\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":42521,"title":"To convolve two vectors ","description":"To convolve two vectors ","description_html":"\u003cp\u003eTo convolve two vectors\u003c/p\u003e","function_template":"function y = convolution(p,q)\r\n % y = enter your solution\r\nend","test_suite":"%%\r\np=[1 3 4];\r\nq=[4 6 9];\r\ny_correct = [4   18   43   51   36];\r\nassert(isequal(convolution(p,q),y_correct))\r\n%%\r\np=[8 3];\r\nq=[2 5];\r\ny_correct = [16   46   15];\r\nassert(isequal(convolution(p,q),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":82,"test_suite_updated_at":"2015-08-24T06:20:19.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-20T12:08:03.000Z","updated_at":"2026-04-04T03:54:39.000Z","published_at":"2015-08-20T12:15:17.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\u003eTo convolve two vectors\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":1667,"title":"What number has this problem?","description":"This problem is added because it is problem number *???* in the \"Community\" problems section.\r\n\r\n\u003chttp://www.mathworks.de/matlabcentral/cody/?sort=\u0026term=group%3ACommunity A lots of problems here!\u003e\r\n\r\n\r\nThank you, Community!\r\n\r\nand... \r\n\r\nThank you Matlab!!","description_html":"\u003cp\u003eThis problem is added because it is problem number \u003cb\u003e???\u003c/b\u003e in the \"Community\" problems section.\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.de/matlabcentral/cody/?sort=\u0026term=group%3ACommunity\"\u003eA lots of problems here!\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThank you, Community!\u003c/p\u003e\u003cp\u003eand...\u003c/p\u003e\u003cp\u003eThank you Matlab!!\u003c/p\u003e","function_template":"function nr = celebrating_Problem()\r\n  nr = ???;\r\nend","test_suite":"%%\r\nweCelebrateProblemNumber = 1000;\r\nassert(isequal(celebrating_Problem(),weCelebrateProblemNumber))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":3038,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":404,"test_suite_updated_at":"2013-06-20T22:47:19.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-06-20T22:38:15.000Z","updated_at":"2026-03-10T15:17:04.000Z","published_at":"2013-06-20T22:47:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis problem is added because it is problem number\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e???\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in the \\\"Community\\\" problems section.\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=\\\"http://www.mathworks.de/matlabcentral/cody/?sort=\u0026amp;term=group%3ACommunity\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eA lots of problems here!\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\u003eThank you, Community!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you Matlab!!\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":42523,"title":"Delete blanks at the end of string","description":"you got to delete all blank spaces which appears at the end of string","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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=\"\"\u003eDelete all white spaces which appears at the end of given strings\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = removeblanks(x)\r\n  y = enter your code\r\nend","test_suite":"%%\r\nx = 'mathworks        ';\r\ny_correct = 'mathworks';\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx = 'delete           ';\r\ny_correct = 'delete';\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx = 'Science';\r\ny_correct = 'Science';\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx = '       function';\r\ny_correct = '       function';\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx = [char(160) 'hello    '];\r\ny_correct = [char(160) 'hello'];\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx=['    Sanitize,your,hands,regularly' repelem(char(160),1,4)];\r\ny_correct = ['    Sanitize,your,hands,regularly' repelem(char(160),1,4)];;\r\nassert(isequal(removeblanks(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":82,"test_suite_updated_at":"2021-02-21T10:13:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-20T12:36:04.000Z","updated_at":"2026-03-04T14:36:01.000Z","published_at":"2015-08-20T12:38:29.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\u003eDelete all white spaces which appears at the end of given strings\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":44096,"title":"Matrix game: Winner takes all","description":"Given a matrix A, return a new matrix of the same size in which the biggest element of each column in A takes 1, and 0 for all the others. So if:\r\n\r\n  input A = [5 4 3;\r\n             1 5 6;\r\n             3 0 9]\r\n  \r\n  output a = [1 0 0;\r\n              0 1 0;\r\n              0 0 1]","description_html":"\u003cp\u003eGiven a matrix A, return a new matrix of the same size in which the biggest element of each column in A takes 1, and 0 for all the others. So if:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003einput A = [5 4 3;\r\n           1 5 6;\r\n           3 0 9]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eoutput a = [1 0 0;\r\n            0 1 0;\r\n            0 0 1]\r\n\u003c/pre\u003e","function_template":"function a = Winner_takes_all(A)\r\n  a = A;\r\nend","test_suite":"%%\r\nA = [5 4 3;1 5 6;3 0 9];\r\na_correct = [1 0 0;0 1 0;0 0 1];\r\nassert(isequal(Winner_takes_all(A),a_correct))\r\n\r\n%%\r\nA = [0.9572 0.1419 0.7922 0.0357;\r\n     0.4854 0.4218 0.9595 0.8491;\r\n     0.8003 0.9157 0.6557 0.9340];\r\na_correct = [1 0 0 0;\r\n             0 0 1 0;\r\n             0 1 0 1];\r\nassert(isequal(Winner_takes_all(A),a_correct))\r\n         \r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":123988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":41,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-04-18T14:20:00.000Z","updated_at":"2026-03-02T15:02:15.000Z","published_at":"2017-04-18T14:20:00.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a matrix A, return a new matrix of the same size in which the biggest element of each column in A takes 1, and 0 for all the others. So if:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[input A = [5 4 3;\\n           1 5 6;\\n           3 0 9]\\n\\noutput a = [1 0 0;\\n            0 1 0;\\n            0 0 1]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42587,"title":"Moore-Penrose pseudoinverse of matrix","description":"Find the command for Moore-Penrose pseudoinverse of matrix and solve ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 10.5px; vertical-align: baseline; perspective-origin: 332px 10.5px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the command for Moore-Penrose pseudoinverse of matrix and solve\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n% find command\r\nend","test_suite":"tolerance = 1e-4;\r\n\r\n%%\r\nx = [1 2;3 4];\r\ny_correct = [-2.00000 1.00000; 1.50000 -0.50000];\r\ny_calc = your_fcn_name(x);\r\ny_diff = abs(y_correct - y_calc);\r\nassert(sum(y_diff(:)) \u003c tolerance)\r\n\r\n%%\r\nx = [0 1; 1 1];\r\ny_correct = [-1.0000e+00 1.0000e+00; 1.0000e+00 -1.1102e-16];\r\ny_calc = your_fcn_name(x);\r\ny_diff = abs(y_correct - y_calc);\r\nassert(sum(y_diff(:)) \u003c tolerance)","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":"2020-09-29T14:06:05.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-04T05:55:10.000Z","updated_at":"2026-04-04T03:53:55.000Z","published_at":"2015-09-04T05:55:10.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\u003eFind the command for Moore-Penrose pseudoinverse of matrix and solve\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":2384,"title":"Integer or Float?","description":"Test an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise return 0 for 'false'.\r\n\r\nExamples\r\n\r\n 1. x=1\r\n    y=1\r\n\r\n 2. x=1.5\r\n    y=0\r\n\r\n 3. x=0\r\n    y=1\r\n\r\n","description_html":"\u003cp\u003eTest an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise return 0 for 'false'.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e 1. x=1\r\n    y=1\u003c/pre\u003e\u003cpre\u003e 2. x=1.5\r\n    y=0\u003c/pre\u003e\u003cpre\u003e 3. x=0\r\n    y=1\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 1.5;\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":27280,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":229,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-25T04:56:56.000Z","updated_at":"2026-02-18T10:29:33.000Z","published_at":"2014-06-25T04:56: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\u003eTest an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise return 0 for 'false'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 1. x=1\\n    y=1\\n\\n 2. x=1.5\\n    y=0\\n\\n 3. x=0\\n    y=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":42537,"title":"Rotate a matrix for 180 degree","description":"Rotate a matrix for 180 degree\r\nfor eg: x=[1 2 3 4]\r\n        y=[4   3   2   1]","description_html":"\u003cp\u003eRotate a matrix for 180 degree\r\nfor eg: x=[1 2 3 4]\r\n        y=[4   3   2   1]\u003c/p\u003e","function_template":"function y = rot(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2 3 4];\r\ny_correct = [4 3 2 1];\r\nassert(isequal(rot(x),y_correct))\r\n\r\n%%\r\nx = [5 6 7 8];\r\ny_correct = [8 7 6 5];\r\nassert(isequal(rot(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":217,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T09:15:15.000Z","updated_at":"2026-02-17T15:57:03.000Z","published_at":"2015-08-24T09:15:15.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\u003eRotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]\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":42522,"title":"string comparision","description":"compare two strings if both are same return 1 else return 0","description_html":"\u003cp\u003ecompare two strings if both are same return 1 else return 0\u003c/p\u003e","function_template":"function y = string_comp(a,b)\r\n  y = enter your solution\r\nend","test_suite":"%%\r\na='azy';\r\nb='azy'\r\ny_correct = 1;\r\nassert(isequal(string_comp(a,b),y_correct))\r\n\r\n%%\r\na='azy';\r\nb='lazy'\r\ny_correct = 0;\r\nassert(isequal(string_comp(a,b),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2018-08-10T16:29:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-20T12:27:19.000Z","updated_at":"2026-02-18T11:21:33.000Z","published_at":"2015-08-20T12:29:18.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\u003ecompare two strings if both are same return 1 else return 0\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":42513,"title":"Is it prime?","description":"Given a number, check whether it is prime or not.\r\n\r\nIf prime output is true, otherwise false.","description_html":"\u003cp\u003eGiven a number, check whether it is prime or not.\u003c/p\u003e\u003cp\u003eIf prime output is true, otherwise false.\u003c/p\u003e","function_template":"function y = prime(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = 5;\r\ny_correct = 'true';\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 4;\r\ny_correct = 'false';\r\nassert(isequal(prime(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":4,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":151,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-18T11:21:38.000Z","updated_at":"2026-03-18T23:49:40.000Z","published_at":"2015-08-18T11:21:45.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\u003eGiven a number, check whether it is prime or not.\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 prime output is true, otherwise false.\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":42531,"title":"volume of torus","description":"Find volume of torus with a as major radius and b as minor","description_html":"\u003cp\u003eFind volume of torus with a as major radius and b as minor\u003c/p\u003e","function_template":"function y = torus_volm(a,b)\r\n% y = google;\r\nend","test_suite":"%%\r\na = 8;\r\nb = 3;\r\ny_correct = 1421.2296;\r\nassert(isequal(torus_volm(a,b),y_correct))\r\n%%\r\na = 6;\r\nb = 2;\r\ny_correct = 473.7432;\r\nassert(isequal(torus_volm(a,b),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T06:16:56.000Z","updated_at":"2026-03-06T14:04:16.000Z","published_at":"2015-08-24T06:16: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\",\"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\u003eFind volume of torus with a as major radius and b as minor\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":42589,"title":"Change number representation to HEX","description":"Given a number change it's representation to HEX and output it.","description_html":"\u003cp\u003eGiven a number change it's representation to HEX and output it.\u003c/p\u003e","function_template":"function y = change2hex(x)\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = 4024000000000000;\r\nassert(isequal(change2hex(x),y_correct))\r\n%%\r\nx = 23;\r\ny_correct = 4037000000000000;\r\nassert(isequal(change2hex(x),y_correct))\r\n%%\r\nx = 294;\r\ny_correct = 4072600000000000;\r\nassert(isequal(change2hex(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":40,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-08T12:39:37.000Z","updated_at":"2025-11-30T13:43:37.000Z","published_at":"2015-09-08T12:48: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\",\"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\u003eGiven a number change it's representation to HEX and output it.\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":44530,"title":"Are you more familiar with iteration methods or Linear Algebra? Let's see together.","description":"Given a sum result *_x_* value of a *_N_* number of addends, build an array of _*N*_ elements _*y*_ such that the following equality is satisfied: _sum(y) = x_ .\r\n\r\nFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or  [8 2].\r\n\r\nMore formally if x = a and N = n it results: \r\n\r\ny = [y_1 y_2 y_3 ... y_n]\r\nwhere:  y_1 + y_2 + y_3 +...+ y_n = a\r\n\r\nImportant notice: All the elements in y must be *different from zero* and *different from each other* . On the other hand I will not take into account if they are _integers or decimal numbers_ .\r\n\r\nHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\r\n\r\nGood luck and enjoy with the solution ;)\r\n","description_html":"\u003cp\u003eGiven a sum result \u003cb\u003e\u003ci\u003ex\u003c/i\u003e\u003c/b\u003e value of a \u003cb\u003e\u003ci\u003eN\u003c/i\u003e\u003c/b\u003e number of addends, build an array of \u003ci\u003e\u003cb\u003eN\u003c/b\u003e\u003c/i\u003e elements \u003ci\u003e\u003cb\u003ey\u003c/b\u003e\u003c/i\u003e such that the following equality is satisfied: \u003ci\u003esum(y) = x\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or  [8 2].\u003c/p\u003e\u003cp\u003eMore formally if x = a and N = n it results:\u003c/p\u003e\u003cp\u003ey = [y_1 y_2 y_3 ... y_n]\r\nwhere:  y_1 + y_2 + y_3 +...+ y_n = a\u003c/p\u003e\u003cp\u003eImportant notice: All the elements in y must be \u003cb\u003edifferent from zero\u003c/b\u003e and \u003cb\u003edifferent from each other\u003c/b\u003e . On the other hand I will not take into account if they are \u003ci\u003eintegers or decimal numbers\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\u003c/p\u003e\u003cp\u003eGood luck and enjoy with the solution ;)\u003c/p\u003e","function_template":"function y = buildSumArray(x,N)\r\n  y = sum(1:N);\r\nend","test_suite":"%% Test Case 1\r\nx = 6;\r\nN = 3;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n%% Test Case 2\r\nx = 13;\r\nN = 5;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n\r\n%% Test Case 3\r\nx = 78;\r\nN = 11;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n\r\n%% Test Case 4\r\nx = 2689;\r\nN = 245;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":181340,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":30,"test_suite_updated_at":"2018-02-24T12:07:13.000Z","rescore_all_solutions":false,"group_id":677,"created_at":"2018-02-24T11:21:15.000Z","updated_at":"2026-04-02T13:09:38.000Z","published_at":"2018-02-24T11:49:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a sum result\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e value of a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e number of addends, build an array of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e elements\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such that the following equality is satisfied:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esum(y) = x\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e .\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or [8 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\u003eMore formally if x = a and N = n it results:\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 = [y_1 y_2 y_3 ... y_n] where: y_1 + y_2 + y_3 +...+ y_n = 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\u003eImportant notice: All the elements in y must be\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edifferent from zero\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edifferent from each other\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . On the other hand I will not take into account if they are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eintegers or decimal numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e .\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGood luck and enjoy with the solution ;)\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":2025,"title":"Find the day for a date","description":"Today's day and date will be given to you. By utilising that you need to find the day of the old date. (Date will be in DD/MM/YYYY format, Consider leap years also).\r\nExample:\r\nTodayDate='20/11/2013'\r\nToday='Monday'\r\nUnknownDay_Date ='19/11/2013'\r\nSo here you need to provide output as UnknownDay='Sunday'\r\nSolve the problem in the hypothetical world where 16 April 2019 happens on Saturday instead of Tuesday.\r\nNote: It is not like using \"datestr\" and finding result. You need to calculate the number of inbetween days and then find the answer.","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: 273px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 136.5px; transform-origin: 407px 136.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 358.5px 8px; transform-origin: 358.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eToday's day and date will be given to you. By utilising that you need to find the day of the old date. (Date will be in DD/MM/YYYY format, Consider leap years also).\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: 28.5px 8px; transform-origin: 28.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eExample:\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: 76.5px 8px; transform-origin: 76.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eTodayDate='20/11/2013'\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: 51px 8px; transform-origin: 51px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eToday='Monday'\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: 104.5px 8px; transform-origin: 104.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUnknownDay_Date ='19/11/2013'\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: 195.5px 8px; transform-origin: 195.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSo here you need to provide output as UnknownDay='Sunday'\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: 333.5px 8px; transform-origin: 333.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSolve the problem in the hypothetical world where 16 April 2019 happens on Saturday instead of Tuesday.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: It is not like using \"datestr\" and finding result. You need to calculate the number of inbetween days and then find the answer.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function UnknownDay = FindDay(TodayDate,Today,UnknownDay_Date)\r\n  UnknownDay= UnknownDay_Date;\r\nend","test_suite":"%%\r\nTodayDate='28/11/2013';\r\nToday='Thursday';\r\nUnknownDay_Date='07/01/1991';\r\ny_correct = 'Monday';\r\nassert(isequal(FindDay(TodayDate,Today,UnknownDay_Date),y_correct))\r\n\r\n%%\r\nTodayDate='20/07/1977';\r\nToday='Wednesday';\r\nUnknownDay_Date='26/01/1950';\r\ny_correct = 'Thursday';\r\nassert(isequal(FindDay(TodayDate,Today,UnknownDay_Date),y_correct))\r\n\r\n%%\r\nTodayDate='16/04/2019';\r\nToday='Saturday';\r\nUnknownDay_Date='22/10/1901';\r\ny_correct = 'Saturday';\r\nassert(isequal(FindDay(TodayDate,Today,UnknownDay_Date),y_correct))\r\n\r\n%%\r\nTodayDate='14/03/2020';\r\nToday='Tuesday';\r\nUnknownDay_Date='12/03/2020';\r\ny_correct = 'Sunday';\r\nassert(isequal(FindDay(TodayDate,Today,UnknownDay_Date),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":13835,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2022-01-28T19:22:15.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-11-28T13:39:50.000Z","updated_at":"2025-11-21T18:25:54.000Z","published_at":"2013-11-28T13:43:46.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\u003eToday's day and date will be given to you. By utilising that you need to find the day of the old date. (Date will be in DD/MM/YYYY format, Consider leap years also).\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\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTodayDate='20/11/2013'\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\u003eToday='Monday'\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\u003eUnknownDay_Date ='19/11/2013'\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\u003eSo here you need to provide output as UnknownDay='Sunday'\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\u003eSolve the problem in the hypothetical world where 16 April 2019 happens on Saturday instead of Tuesday.\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\u003eNote: It is not like using \\\"datestr\\\" and finding result. You need to calculate the number of inbetween days and then find the answer.\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\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":42524,"title":"Xor of matrix","description":"you have to set exclusive OR of two arrays","description_html":"\u003cp\u003eyou have to set exclusive OR of two arrays\u003c/p\u003e","function_template":"function y = array_xor(a,b)\r\ny = enter your code\r\nend","test_suite":"%%\r\na=[1 2 5];\r\nb=[6 4 3];\r\ny_correct = [1   2   3   4   5   6];\r\nassert(isequal(array_xor(a,b),y_correct))\r\n%%\r\na=[1 2 5 4];\r\nb=[8 6 9 2];\r\ny_correct = [1   4   5   6   8   9];\r\nassert(isequal(array_xor(a,b),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":61,"test_suite_updated_at":"2015-08-24T06:22:20.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-20T12:48:44.000Z","updated_at":"2026-02-15T10:40:05.000Z","published_at":"2015-08-20T12:52:25.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eyou have to set exclusive OR of two arrays\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":42532,"title":"Find minimum and maximum elements of an array","description":"For a given array find minimum and maximum elements of an array and store minimum value in first index of output and maximum in 2nd.","description_html":"\u003cp\u003eFor a given array find minimum and maximum elements of an array and store minimum value in first index of output and maximum in 2nd.\u003c/p\u003e","function_template":"function y = min_max(a)\r\n%  y = google\r\nend","test_suite":"%%\r\na = [12 78 5 23 09 67 82 18];\r\ny_correct = [5 82];\r\nassert(isequal(min_max(a),y_correct))\r\n%%\r\na = [12 178 15 23 09 67 82 18];\r\ny_correct = [09 178];\r\nassert(isequal(min_max(a),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":146,"test_suite_updated_at":"2015-08-24T08:47:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T08:45:34.000Z","updated_at":"2026-03-22T09:11:20.000Z","published_at":"2015-08-24T08:45: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\",\"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 a given array find minimum and maximum elements of an array and store minimum value in first index of output and maximum in 2nd.\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":2353,"title":"Sum of the Matrix Elements","description":"Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\r\n\r\nExample : \r\n\r\nx=  [ 8     1     6]\r\n     \r\n \r\nThe total sum of the elements will be 8+1+6= 15.\r\n","description_html":"\u003cp\u003eAdd up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\u003c/p\u003e\u003cp\u003eExample :\u003c/p\u003e\u003cp\u003ex=  [ 8     1     6]\u003c/p\u003e\u003cp\u003eThe total sum of the elements will be 8+1+6= 15.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1];\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":2,"created_by":27280,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":601,"test_suite_updated_at":"2014-06-08T12:50:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-08T12:46:47.000Z","updated_at":"2026-02-05T19:39:47.000Z","published_at":"2014-06-08T12:50: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\u003eAdd up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\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\u003eExample :\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex= [ 8 1 6]\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\u003eThe total sum of the elements will be 8+1+6= 15.\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":42582,"title":"Output a vector which is table of 9","description":"Output a vector which is table of 9","description_html":"\u003cp\u003eOutput a vector which is table of 9\u003c/p\u003e","function_template":"function y = tab9()\r\n% y = multiple(9);\r\nend","test_suite":"%%\r\ny_correct = [0 9 18 27 36 45 54 63 72 81 90];\r\nassert(isequal(tab9(),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":179,"test_suite_updated_at":"2015-08-28T11:31:12.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-28T11:28:37.000Z","updated_at":"2026-02-19T14:25:41.000Z","published_at":"2015-08-28T11:31: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\u003eOutput a vector which is table of 9\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":2387,"title":"Are you in XY plane?","description":"Take a point P as an input position Vector (x,y,z). If you are in XY plane, return 1 as an output otherwise return 0.\r\n\r\nExample-\r\n\r\n1.x=[3 4 5]\r\n  y=0\r\n\r\n2.x=[3 4 0]\r\n  y=1","description_html":"\u003cp\u003eTake a point P as an input position Vector (x,y,z). If you are in XY plane, return 1 as an output otherwise return 0.\u003c/p\u003e\u003cp\u003eExample-\u003c/p\u003e\u003cp\u003e1.x=[3 4 5]\r\n  y=0\u003c/p\u003e\u003cp\u003e2.x=[3 4 0]\r\n  y=1\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx =[3 4 5];\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [3 4 0];\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":27280,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":185,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-25T05:18:28.000Z","updated_at":"2026-02-12T15:34:44.000Z","published_at":"2014-06-25T05:19:08.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\u003eTake a point P as an input position Vector (x,y,z). If you are in XY plane, return 1 as an output otherwise return 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\u003eExample-\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1.x=[3 4 5] y=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\u003e2.x=[3 4 0] y=1\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":42516,"title":"Calculate Simple Intrest for given data","description":"P,N,R stands for Principle amount, No. of years and rate of intrest resp. Calculate intrest I","description_html":"\u003cp\u003eP,N,R stands for Principle amount, No. of years and rate of intrest resp. Calculate intrest I\u003c/p\u003e","function_template":"function I = SI(p,n,r)\r\n  I = p*n*r;\r\nend","test_suite":"%%\r\np = 1000;\r\nn=2;\r\nr=8;\r\ny_correct = 160;\r\nassert(isequal(SI(p,n,r),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":83,"test_suite_updated_at":"2015-08-19T12:44:01.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-08-19T12:37:41.000Z","updated_at":"2026-02-16T11:49:15.000Z","published_at":"2015-08-19T12:38:45.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\u003eP,N,R stands for Principle amount, No. of years and rate of intrest resp. Calculate intrest I\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":42511,"title":"calculate Compound Intrest","description":"Calculate Compound Intrest for given data","description_html":"\u003cp\u003eCalculate Compound Intrest for given data\u003c/p\u003e","function_template":"function y = your_fcn_name(p,R,n)\r\n  y = \r\nend","test_suite":"%%\r\np= 100;\r\nR=10\r\nn=1\r\ny_correct = 110;\r\nassert(isequal(your_fcn_name(p,R,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":93,"test_suite_updated_at":"2015-08-18T10:21:05.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-18T10:17:15.000Z","updated_at":"2026-02-11T14:31:58.000Z","published_at":"2015-08-18T10:17: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\",\"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\u003eCalculate Compound Intrest for given data\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":44664,"title":"function to compute root mean square of first nn positive odd integers","description":"Write a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.","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: 84px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 42px; transform-origin: 407px 42px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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 42px; text-align: left; transform-origin: 384px 42px; 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: 367px 8px; transform-origin: 367px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function orms = odd_rms(nn)\r\n  \r\nend","test_suite":"%%\r\nnn = 3;\r\norms_correct = 3.4156\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)\r\n\r\n%%\r\nnn = 10;\r\norms_correct = 11.5325\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)\r\n\r\n%%\r\nnn = 1;\r\norms_correct = 1\r\nassert(abs(odd_rms(nn)-orms_correct)\u003c0.5)","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2021-12-31T17:41:47.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T15:13:46.000Z","updated_at":"2026-02-17T08:34:38.000Z","published_at":"2018-05-29T15:13:46.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\u003eWrite a function called odd_rms that returns orms, which is the square root of the mean of the squares of the first nn positive odd integers, where nn is a positive integer and is the only input argument. For example, if nn is 3, your function needs to compute and return the square root of the average of the numbers 1, 9, and 25. You may use built-in functions including, for example, sum and sqrt, except for the built-in function rms, which is not allowed.\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":42706,"title":"Step up","description":"For given input array, output a array with all elements step up by two","description_html":"\u003cp\u003eFor given input array, output a array with all elements step up by two\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n%guess\r\nend","test_suite":"%%\r\nx = [1 8 9 2];\r\ny_correct = [3 10 11 4];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 11 19 21];\r\ny_correct = [3 13 21 23];\r\nassert(isequal(your_fcn_name(x),y_correct))%%\r\nx = [30 63 12 2];\r\ny_correct = [32 65 14 4];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":106,"test_suite_updated_at":"2016-01-07T13:55:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-01-07T13:51:19.000Z","updated_at":"2026-02-10T18:42:11.000Z","published_at":"2016-01-07T13:55:09.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 given input array, output a array with all elements step up by two\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":42585,"title":"Permutations of input vector","description":"Find and output all permutations of given vector","description_html":"\u003cp\u003eFind and output all permutations of given vector\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 1];\r\ny_correct = [1 1; 1 1];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 4];\r\ny_correct = [4 1; 1 4];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":81,"test_suite_updated_at":"2015-09-02T13:08:46.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-02T13:04:03.000Z","updated_at":"2026-02-20T13:52:24.000Z","published_at":"2015-09-02T13:08:46.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eFind and output all permutations of given vector\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":42536,"title":"Rotate a matrix for 180 degree","description":"Rotate a matrix for 180 degree\r\nfor eg: x=[1 2 3 4]\r\n        y=[4   3   2   1]","description_html":"\u003cp\u003eRotate a matrix for 180 degree\r\nfor eg: x=[1 2 3 4]\r\n        y=[4   3   2   1]\u003c/p\u003e","function_template":"function y = rot(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2 3 4];\r\ny_correct = [4 3 2 1];\r\nassert(isequal(rot(x),y_correct))\r\n\r\n%%\r\nx = [5 6 7 8];\r\ny_correct = [8 7 6 5];\r\nassert(isequal(rot(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":187,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T09:14:06.000Z","updated_at":"2026-02-16T12:21:36.000Z","published_at":"2015-08-24T09:14:06.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\u003eRotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]\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":42534,"title":"find whether it is prime or not","description":"For a given number find if its prime","description_html":"\u003cp\u003eFor a given number find if its prime\u003c/p\u003e","function_template":"function y = prime(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 22;\r\ny_correct = 0;\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 22;\r\ny_correct = 0;\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 21;\r\ny_correct = 0;\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 5;\r\ny_correct = 1;\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 3;\r\ny_correct = 1;\r\nassert(isequal(prime(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":157,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T09:05:06.000Z","updated_at":"2026-02-09T16:39:49.000Z","published_at":"2015-08-24T09:05:06.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 a given number find if its prime\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":42521,"title":"To convolve two vectors ","description":"To convolve two vectors ","description_html":"\u003cp\u003eTo convolve two vectors\u003c/p\u003e","function_template":"function y = convolution(p,q)\r\n % y = enter your solution\r\nend","test_suite":"%%\r\np=[1 3 4];\r\nq=[4 6 9];\r\ny_correct = [4   18   43   51   36];\r\nassert(isequal(convolution(p,q),y_correct))\r\n%%\r\np=[8 3];\r\nq=[2 5];\r\ny_correct = [16   46   15];\r\nassert(isequal(convolution(p,q),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":82,"test_suite_updated_at":"2015-08-24T06:20:19.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-20T12:08:03.000Z","updated_at":"2026-04-04T03:54:39.000Z","published_at":"2015-08-20T12:15:17.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\u003eTo convolve two vectors\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":1667,"title":"What number has this problem?","description":"This problem is added because it is problem number *???* in the \"Community\" problems section.\r\n\r\n\u003chttp://www.mathworks.de/matlabcentral/cody/?sort=\u0026term=group%3ACommunity A lots of problems here!\u003e\r\n\r\n\r\nThank you, Community!\r\n\r\nand... \r\n\r\nThank you Matlab!!","description_html":"\u003cp\u003eThis problem is added because it is problem number \u003cb\u003e???\u003c/b\u003e in the \"Community\" problems section.\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.de/matlabcentral/cody/?sort=\u0026term=group%3ACommunity\"\u003eA lots of problems here!\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThank you, Community!\u003c/p\u003e\u003cp\u003eand...\u003c/p\u003e\u003cp\u003eThank you Matlab!!\u003c/p\u003e","function_template":"function nr = celebrating_Problem()\r\n  nr = ???;\r\nend","test_suite":"%%\r\nweCelebrateProblemNumber = 1000;\r\nassert(isequal(celebrating_Problem(),weCelebrateProblemNumber))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":3038,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":404,"test_suite_updated_at":"2013-06-20T22:47:19.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-06-20T22:38:15.000Z","updated_at":"2026-03-10T15:17:04.000Z","published_at":"2013-06-20T22:47:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis problem is added because it is problem number\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e???\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in the \\\"Community\\\" problems section.\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=\\\"http://www.mathworks.de/matlabcentral/cody/?sort=\u0026amp;term=group%3ACommunity\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eA lots of problems here!\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\u003eThank you, Community!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThank you Matlab!!\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":42523,"title":"Delete blanks at the end of string","description":"you got to delete all blank spaces which appears at the end of string","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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=\"\"\u003eDelete all white spaces which appears at the end of given strings\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = removeblanks(x)\r\n  y = enter your code\r\nend","test_suite":"%%\r\nx = 'mathworks        ';\r\ny_correct = 'mathworks';\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx = 'delete           ';\r\ny_correct = 'delete';\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx = 'Science';\r\ny_correct = 'Science';\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx = '       function';\r\ny_correct = '       function';\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx = [char(160) 'hello    '];\r\ny_correct = [char(160) 'hello'];\r\nassert(isequal(removeblanks(x),y_correct))\r\n%%\r\nx=['    Sanitize,your,hands,regularly' repelem(char(160),1,4)];\r\ny_correct = ['    Sanitize,your,hands,regularly' repelem(char(160),1,4)];;\r\nassert(isequal(removeblanks(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":82,"test_suite_updated_at":"2021-02-21T10:13:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-20T12:36:04.000Z","updated_at":"2026-03-04T14:36:01.000Z","published_at":"2015-08-20T12:38:29.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\u003eDelete all white spaces which appears at the end of given strings\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":44096,"title":"Matrix game: Winner takes all","description":"Given a matrix A, return a new matrix of the same size in which the biggest element of each column in A takes 1, and 0 for all the others. So if:\r\n\r\n  input A = [5 4 3;\r\n             1 5 6;\r\n             3 0 9]\r\n  \r\n  output a = [1 0 0;\r\n              0 1 0;\r\n              0 0 1]","description_html":"\u003cp\u003eGiven a matrix A, return a new matrix of the same size in which the biggest element of each column in A takes 1, and 0 for all the others. So if:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003einput A = [5 4 3;\r\n           1 5 6;\r\n           3 0 9]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eoutput a = [1 0 0;\r\n            0 1 0;\r\n            0 0 1]\r\n\u003c/pre\u003e","function_template":"function a = Winner_takes_all(A)\r\n  a = A;\r\nend","test_suite":"%%\r\nA = [5 4 3;1 5 6;3 0 9];\r\na_correct = [1 0 0;0 1 0;0 0 1];\r\nassert(isequal(Winner_takes_all(A),a_correct))\r\n\r\n%%\r\nA = [0.9572 0.1419 0.7922 0.0357;\r\n     0.4854 0.4218 0.9595 0.8491;\r\n     0.8003 0.9157 0.6557 0.9340];\r\na_correct = [1 0 0 0;\r\n             0 0 1 0;\r\n             0 1 0 1];\r\nassert(isequal(Winner_takes_all(A),a_correct))\r\n         \r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":123988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":41,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-04-18T14:20:00.000Z","updated_at":"2026-03-02T15:02:15.000Z","published_at":"2017-04-18T14:20:00.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a matrix A, return a new matrix of the same size in which the biggest element of each column in A takes 1, and 0 for all the others. So if:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[input A = [5 4 3;\\n           1 5 6;\\n           3 0 9]\\n\\noutput a = [1 0 0;\\n            0 1 0;\\n            0 0 1]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42587,"title":"Moore-Penrose pseudoinverse of matrix","description":"Find the command for Moore-Penrose pseudoinverse of matrix and solve ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 10.5px; vertical-align: baseline; perspective-origin: 332px 10.5px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the command for Moore-Penrose pseudoinverse of matrix and solve\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n% find command\r\nend","test_suite":"tolerance = 1e-4;\r\n\r\n%%\r\nx = [1 2;3 4];\r\ny_correct = [-2.00000 1.00000; 1.50000 -0.50000];\r\ny_calc = your_fcn_name(x);\r\ny_diff = abs(y_correct - y_calc);\r\nassert(sum(y_diff(:)) \u003c tolerance)\r\n\r\n%%\r\nx = [0 1; 1 1];\r\ny_correct = [-1.0000e+00 1.0000e+00; 1.0000e+00 -1.1102e-16];\r\ny_calc = your_fcn_name(x);\r\ny_diff = abs(y_correct - y_calc);\r\nassert(sum(y_diff(:)) \u003c tolerance)","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":39,"test_suite_updated_at":"2020-09-29T14:06:05.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-04T05:55:10.000Z","updated_at":"2026-04-04T03:53:55.000Z","published_at":"2015-09-04T05:55:10.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\u003eFind the command for Moore-Penrose pseudoinverse of matrix and solve\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":2384,"title":"Integer or Float?","description":"Test an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise return 0 for 'false'.\r\n\r\nExamples\r\n\r\n 1. x=1\r\n    y=1\r\n\r\n 2. x=1.5\r\n    y=0\r\n\r\n 3. x=0\r\n    y=1\r\n\r\n","description_html":"\u003cp\u003eTest an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise return 0 for 'false'.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e 1. x=1\r\n    y=1\u003c/pre\u003e\u003cpre\u003e 2. x=1.5\r\n    y=0\u003c/pre\u003e\u003cpre\u003e 3. x=0\r\n    y=1\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 1.5;\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":27280,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":229,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-25T04:56:56.000Z","updated_at":"2026-02-18T10:29:33.000Z","published_at":"2014-06-25T04:56: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\u003eTest an input to see whether it is an integer or a floating point number. If it is an integer return 1 for 'true'. Otherwise return 0 for 'false'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ 1. x=1\\n    y=1\\n\\n 2. x=1.5\\n    y=0\\n\\n 3. x=0\\n    y=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":42537,"title":"Rotate a matrix for 180 degree","description":"Rotate a matrix for 180 degree\r\nfor eg: x=[1 2 3 4]\r\n        y=[4   3   2   1]","description_html":"\u003cp\u003eRotate a matrix for 180 degree\r\nfor eg: x=[1 2 3 4]\r\n        y=[4   3   2   1]\u003c/p\u003e","function_template":"function y = rot(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2 3 4];\r\ny_correct = [4 3 2 1];\r\nassert(isequal(rot(x),y_correct))\r\n\r\n%%\r\nx = [5 6 7 8];\r\ny_correct = [8 7 6 5];\r\nassert(isequal(rot(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":217,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T09:15:15.000Z","updated_at":"2026-02-17T15:57:03.000Z","published_at":"2015-08-24T09:15:15.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\u003eRotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]\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":42522,"title":"string comparision","description":"compare two strings if both are same return 1 else return 0","description_html":"\u003cp\u003ecompare two strings if both are same return 1 else return 0\u003c/p\u003e","function_template":"function y = string_comp(a,b)\r\n  y = enter your solution\r\nend","test_suite":"%%\r\na='azy';\r\nb='azy'\r\ny_correct = 1;\r\nassert(isequal(string_comp(a,b),y_correct))\r\n\r\n%%\r\na='azy';\r\nb='lazy'\r\ny_correct = 0;\r\nassert(isequal(string_comp(a,b),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2018-08-10T16:29:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-20T12:27:19.000Z","updated_at":"2026-02-18T11:21:33.000Z","published_at":"2015-08-20T12:29:18.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\u003ecompare two strings if both are same return 1 else return 0\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":42513,"title":"Is it prime?","description":"Given a number, check whether it is prime or not.\r\n\r\nIf prime output is true, otherwise false.","description_html":"\u003cp\u003eGiven a number, check whether it is prime or not.\u003c/p\u003e\u003cp\u003eIf prime output is true, otherwise false.\u003c/p\u003e","function_template":"function y = prime(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = 5;\r\ny_correct = 'true';\r\nassert(isequal(prime(x),y_correct))\r\n\r\nx = 4;\r\ny_correct = 'false';\r\nassert(isequal(prime(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":4,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":151,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-18T11:21:38.000Z","updated_at":"2026-03-18T23:49:40.000Z","published_at":"2015-08-18T11:21:45.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\u003eGiven a number, check whether it is prime or not.\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 prime output is true, otherwise false.\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":42531,"title":"volume of torus","description":"Find volume of torus with a as major radius and b as minor","description_html":"\u003cp\u003eFind volume of torus with a as major radius and b as minor\u003c/p\u003e","function_template":"function y = torus_volm(a,b)\r\n% y = google;\r\nend","test_suite":"%%\r\na = 8;\r\nb = 3;\r\ny_correct = 1421.2296;\r\nassert(isequal(torus_volm(a,b),y_correct))\r\n%%\r\na = 6;\r\nb = 2;\r\ny_correct = 473.7432;\r\nassert(isequal(torus_volm(a,b),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-24T06:16:56.000Z","updated_at":"2026-03-06T14:04:16.000Z","published_at":"2015-08-24T06:16: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\",\"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\u003eFind volume of torus with a as major radius and b as minor\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":42589,"title":"Change number representation to HEX","description":"Given a number change it's representation to HEX and output it.","description_html":"\u003cp\u003eGiven a number change it's representation to HEX and output it.\u003c/p\u003e","function_template":"function y = change2hex(x)\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = 4024000000000000;\r\nassert(isequal(change2hex(x),y_correct))\r\n%%\r\nx = 23;\r\ny_correct = 4037000000000000;\r\nassert(isequal(change2hex(x),y_correct))\r\n%%\r\nx = 294;\r\ny_correct = 4072600000000000;\r\nassert(isequal(change2hex(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":46868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":40,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-08T12:39:37.000Z","updated_at":"2025-11-30T13:43:37.000Z","published_at":"2015-09-08T12:48: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\",\"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\u003eGiven a number change it's representation to HEX and output it.\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":44530,"title":"Are you more familiar with iteration methods or Linear Algebra? Let's see together.","description":"Given a sum result *_x_* value of a *_N_* number of addends, build an array of _*N*_ elements _*y*_ such that the following equality is satisfied: _sum(y) = x_ .\r\n\r\nFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or  [8 2].\r\n\r\nMore formally if x = a and N = n it results: \r\n\r\ny = [y_1 y_2 y_3 ... y_n]\r\nwhere:  y_1 + y_2 + y_3 +...+ y_n = a\r\n\r\nImportant notice: All the elements in y must be *different from zero* and *different from each other* . On the other hand I will not take into account if they are _integers or decimal numbers_ .\r\n\r\nHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\r\n\r\nGood luck and enjoy with the solution ;)\r\n","description_html":"\u003cp\u003eGiven a sum result \u003cb\u003e\u003ci\u003ex\u003c/i\u003e\u003c/b\u003e value of a \u003cb\u003e\u003ci\u003eN\u003c/i\u003e\u003c/b\u003e number of addends, build an array of \u003ci\u003e\u003cb\u003eN\u003c/b\u003e\u003c/i\u003e elements \u003ci\u003e\u003cb\u003ey\u003c/b\u003e\u003c/i\u003e such that the following equality is satisfied: \u003ci\u003esum(y) = x\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or  [8 2].\u003c/p\u003e\u003cp\u003eMore formally if x = a and N = n it results:\u003c/p\u003e\u003cp\u003ey = [y_1 y_2 y_3 ... y_n]\r\nwhere:  y_1 + y_2 + y_3 +...+ y_n = a\u003c/p\u003e\u003cp\u003eImportant notice: All the elements in y must be \u003cb\u003edifferent from zero\u003c/b\u003e and \u003cb\u003edifferent from each other\u003c/b\u003e . On the other hand I will not take into account if they are \u003ci\u003eintegers or decimal numbers\u003c/i\u003e .\u003c/p\u003e\u003cp\u003eHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\u003c/p\u003e\u003cp\u003eGood luck and enjoy with the solution ;)\u003c/p\u003e","function_template":"function y = buildSumArray(x,N)\r\n  y = sum(1:N);\r\nend","test_suite":"%% Test Case 1\r\nx = 6;\r\nN = 3;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n%% Test Case 2\r\nx = 13;\r\nN = 5;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n\r\n%% Test Case 3\r\nx = 78;\r\nN = 11;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n\r\n\r\n%% Test Case 4\r\nx = 2689;\r\nN = 245;\r\ny = buildSumArray(x,N);\r\ny2 = unique(y);\r\n\r\nassert(isequal(round(sum(y)*100)/100,x))\r\nassert(isequal(length(y),N))\r\nassert(isequal(length(y2),N))\r\nassert(sum(y == 0) == 0)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":181340,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":30,"test_suite_updated_at":"2018-02-24T12:07:13.000Z","rescore_all_solutions":false,"group_id":677,"created_at":"2018-02-24T11:21:15.000Z","updated_at":"2026-04-02T13:09:38.000Z","published_at":"2018-02-24T11:49:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a sum result\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e value of a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e number of addends, build an array of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e elements\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such that the following equality is satisfied:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esum(y) = x\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e .\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example if: x = 10 and N = 2, possible solutions for y are: [7 3], or [8 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\u003eMore formally if x = a and N = n it results:\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 = [y_1 y_2 y_3 ... y_n] where: y_1 + y_2 + y_3 +...+ y_n = 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\u003eImportant notice: All the elements in y must be\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edifferent from zero\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edifferent from each other\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . On the other hand I will not take into account if they are\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eintegers or decimal numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e .\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGood luck and enjoy with the solution ;)\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":2025,"title":"Find the day for a date","description":"Today's day and date will be given to you. By utilising that you need to find the day of the old date. (Date will be in DD/MM/YYYY format, Consider leap years also).\r\nExample:\r\nTodayDate='20/11/2013'\r\nToday='Monday'\r\nUnknownDay_Date ='19/11/2013'\r\nSo here you need to provide output as UnknownDay='Sunday'\r\nSolve the problem in the hypothetical world where 16 April 2019 happens on Saturday instead of Tuesday.\r\nNote: It is not like using \"datestr\" and finding result. You need to calculate the number of inbetween days and then find the answer.","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: 273px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 136.5px; transform-origin: 407px 136.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 358.5px 8px; transform-origin: 358.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eToday's day and date will be given to you. By utilising that you need to find the day of the old date. (Date will be in DD/MM/YYYY format, Consider leap years also).\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: 28.5px 8px; transform-origin: 28.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eExample:\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: 76.5px 8px; transform-origin: 76.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eTodayDate='20/11/2013'\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: 51px 8px; transform-origin: 51px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eToday='Monday'\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: 104.5px 8px; transform-origin: 104.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUnknownDay_Date ='19/11/2013'\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: 195.5px 8px; transform-origin: 195.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSo here you need to provide output as UnknownDay='Sunday'\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: 333.5px 8px; transform-origin: 333.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSolve the problem in the hypothetical world where 16 April 2019 happens on Saturday instead of Tuesday.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: It is not like using \"datestr\" and finding result. You need to calculate the number of inbetween days and then find the answer.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function UnknownDay = FindDay(TodayDate,Today,UnknownDay_Date)\r\n  UnknownDay= UnknownDay_Date;\r\nend","test_suite":"%%\r\nTodayDate='28/11/2013';\r\nToday='Thursday';\r\nUnknownDay_Date='07/01/1991';\r\ny_correct = 'Monday';\r\nassert(isequal(FindDay(TodayDate,Today,UnknownDay_Date),y_correct))\r\n\r\n%%\r\nTodayDate='20/07/1977';\r\nToday='Wednesday';\r\nUnknownDay_Date='26/01/1950';\r\ny_correct = 'Thursday';\r\nassert(isequal(FindDay(TodayDate,Today,UnknownDay_Date),y_correct))\r\n\r\n%%\r\nTodayDate='16/04/2019';\r\nToday='Saturday';\r\nUnknownDay_Date='22/10/1901';\r\ny_correct = 'Saturday';\r\nassert(isequal(FindDay(TodayDate,Today,UnknownDay_Date),y_correct))\r\n\r\n%%\r\nTodayDate='14/03/2020';\r\nToday='Tuesday';\r\nUnknownDay_Date='12/03/2020';\r\ny_correct = 'Sunday';\r\nassert(isequal(FindDay(TodayDate,Today,UnknownDay_Date),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":13835,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2022-01-28T19:22:15.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-11-28T13:39:50.000Z","updated_at":"2025-11-21T18:25:54.000Z","published_at":"2013-11-28T13:43:46.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\u003eToday's day and date will be given to you. By utilising that you need to find the day of the old date. (Date will be in DD/MM/YYYY format, Consider leap years also).\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\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTodayDate='20/11/2013'\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\u003eToday='Monday'\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\u003eUnknownDay_Date ='19/11/2013'\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\u003eSo here you need to provide output as UnknownDay='Sunday'\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\u003eSolve the problem in the hypothetical world where 16 April 2019 happens on Saturday instead of Tuesday.\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\u003eNote: It is not like using \\\"datestr\\\" and finding result. You need to calculate the number of inbetween days and then find the answer.\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\"}]}"}],"term":"tag:\"community\"","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:\"community\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"community\"","","\"","community","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f534a0da3c8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f534a0da328\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f534a0d9a68\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f534a0da648\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f534a0da5a8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f534a0da508\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f534a0da468\u003e":"tag:\"community\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f534a0da468\u003e":"tag:\"community\""},"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:\"community\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"community\"","","\"","community","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f534a0da3c8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f534a0da328\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f534a0d9a68\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f534a0da648\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f534a0da5a8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f534a0da508\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f534a0da468\u003e":"tag:\"community\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f534a0da468\u003e":"tag:\"community\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":42524,"difficulty_rating":"easy"},{"id":42532,"difficulty_rating":"easy"},{"id":2353,"difficulty_rating":"easy"},{"id":42582,"difficulty_rating":"easy"},{"id":2387,"difficulty_rating":"easy"},{"id":42516,"difficulty_rating":"easy"},{"id":42511,"difficulty_rating":"easy"},{"id":44664,"difficulty_rating":"easy"},{"id":42706,"difficulty_rating":"easy"},{"id":42585,"difficulty_rating":"easy"},{"id":42536,"difficulty_rating":"easy"},{"id":42534,"difficulty_rating":"easy"},{"id":42521,"difficulty_rating":"easy"},{"id":1667,"difficulty_rating":"easy"},{"id":42523,"difficulty_rating":"easy"},{"id":44096,"difficulty_rating":"easy"},{"id":42587,"difficulty_rating":"easy"},{"id":2384,"difficulty_rating":"easy"},{"id":42537,"difficulty_rating":"easy"},{"id":42522,"difficulty_rating":"easy"},{"id":42513,"difficulty_rating":"easy"},{"id":42531,"difficulty_rating":"easy"},{"id":42589,"difficulty_rating":"easy"},{"id":44530,"difficulty_rating":"easy-medium"},{"id":2025,"difficulty_rating":"easy-medium"}]}}