{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-10-13T00:15:37.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-10-13T00: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":43162,"title":"Translate German decimals to English decimals","description":"The string 'x = [2,5; 5,5; 4,3];' should return 'y = [2.5; 5.5; 4.3];'","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: 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: 196.5px 8px; transform-origin: 196.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe string 'x = [2,5; 5,5; 4,3];' should return 'y = [2.5; 5.5; 4.3];'\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = translate(x)\r\n  y = 'x in German';\r\nend","test_suite":"%%\r\nx = 'x = [2,5; 5,5; 4,3];';\r\ny_correct = 'y = [2.5; 5.5; 4.3];';\r\nassert(isequal(translate(x),y_correct))\r\n\r\n%%\r\nx = 'x = [2,25; 5,35; 4,13];';\r\ny_correct = 'y = [2.25; 5.35; 4.13];';\r\nassert(isequal(translate(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":57323,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":"2021-08-12T17:40:06.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T15:05:46.000Z","updated_at":"2026-05-29T01:26:30.000Z","published_at":"2016-10-07T15:05: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\u003eThe string 'x = [2,5; 5,5; 4,3];' should return 'y = [2.5; 5.5; 4.3];'\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":2395,"title":"Simple Past of Regular Verbs","description":"Given a regular verb, return the simple past.\r\n\r\nExample\r\n\r\n Input verb = 'to work'\r\n Output simple_past = 'worked'","description_html":"\u003cp\u003eGiven a regular verb, return the simple past.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e Input verb = 'to work'\r\n Output simple_past = 'worked'\u003c/pre\u003e","function_template":"function simple_past = regverb2simplepast(verb)\r\n  simple_past = verb;\r\nend","test_suite":"%%\r\nx = 'to work';\r\ny_correct = 'worked';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to push';\r\ny_correct = 'pushed';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to use';\r\ny_correct = 'used';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to arrive';\r\ny_correct = 'arrived';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to stop';\r\ny_correct = 'stopped';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to prefer';\r\ny_correct = 'preferred';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to discover';\r\ny_correct = 'discovered';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to mix';\r\ny_correct = 'mixed';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to carry';\r\ny_correct = 'carried';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to rely';\r\ny_correct = 'relied';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to dry';\r\ny_correct = 'dried';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to play';\r\ny_correct = 'played';\r\nassert(isequal(regverb2simplepast(x),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":4,"created_by":27228,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":25,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-29T13:20:41.000Z","updated_at":"2026-07-23T11:42:42.000Z","published_at":"2014-06-29T13:26:04.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 regular verb, return the simple past.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ Input verb = 'to work'\\n Output simple_past = 'worked']]\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":518,"title":"English to Pig Latin Translator","description":"Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin):\r\n\r\n1. In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and \"ay\" is added, as in the following examples:\r\n\r\n* happy → appy-hay\r\n* question → estion-quay\r\n\r\n2. In words that begin with vowels, the syllable \"ay\" is simply added to the end of the word.\r\n\r\n* another → another-ay\r\n* about → about-ay\r\n\r\nA hyphen is sometimes used to facilitate translation back into English. Ayspray, for instance, is ambiguous, but ay-spray means \"spray\" whereas ays-pray means \"prays.\"\r\n\r\nGiven a string in english (may be multiple words), produce the Pig Latin version.","description_html":"\u003cp\u003ePig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin):\u003c/p\u003e\u003cp\u003e1. In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and \"ay\" is added, as in the following examples:\u003c/p\u003e\u003cul\u003e\u003cli\u003ehappy → appy-hay\u003c/li\u003e\u003cli\u003equestion → estion-quay\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e2. In words that begin with vowels, the syllable \"ay\" is simply added to the end of the word.\u003c/p\u003e\u003cul\u003e\u003cli\u003eanother → another-ay\u003c/li\u003e\u003cli\u003eabout → about-ay\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eA hyphen is sometimes used to facilitate translation back into English. Ayspray, for instance, is ambiguous, but ay-spray means \"spray\" whereas ays-pray means \"prays.\"\u003c/p\u003e\u003cp\u003eGiven a string in english (may be multiple words), produce the Pig Latin version.\u003c/p\u003e","function_template":"function p = english2piglatin( e )\r\n  p = e;\r\nend","test_suite":"%%\r\nstr1 = 'question';\r\nstr2 = 'estion-quay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'another';\r\nstr2 = 'another-ay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'nix';\r\nstr2 = 'ix-nay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'another one bites the dust';\r\nstr2 = 'another-ay one-ay ites-bay e-thay ust-day';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'how much wood would a woodchuck chuck if a woodchuck could chuck wood';\r\nstr2 = 'ow-hay uch-may ood-way ould-way a-ay oodchuck-way uck-chay if-ay a-ay oodchuck-way ould-cay uck-chay ood-way';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'peter piper picked a peck of pickle peppers';\r\nstr2 = 'eter-pay iper-pay icked-pay a-ay eck-pay of-ay ickle-pay eppers-pay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'four score';\r\nstr2 = 'our-fay ore-scay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":164,"test_suite_updated_at":"2016-12-12T17:54:21.000Z","rescore_all_solutions":false,"group_id":14,"created_at":"2012-03-22T14:56:07.000Z","updated_at":"2026-07-15T14:28:57.000Z","published_at":"2012-03-22T15:02:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin):\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\u003e1. In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and \\\"ay\\\" is added, as in the following examples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ehappy → appy-hay\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003equestion → estion-quay\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\u003e2. In words that begin with vowels, the syllable \\\"ay\\\" is simply added to the end of the word.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eanother → another-ay\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eabout → about-ay\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA hyphen is sometimes used to facilitate translation back into English. Ayspray, for instance, is ambiguous, but ay-spray means \\\"spray\\\" whereas ays-pray means \\\"prays.\\\"\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\u003eGiven a string in english (may be multiple words), produce the Pig Latin version.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"problems":[{"id":43162,"title":"Translate German decimals to English decimals","description":"The string 'x = [2,5; 5,5; 4,3];' should return 'y = [2.5; 5.5; 4.3];'","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: 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: 196.5px 8px; transform-origin: 196.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe string 'x = [2,5; 5,5; 4,3];' should return 'y = [2.5; 5.5; 4.3];'\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = translate(x)\r\n  y = 'x in German';\r\nend","test_suite":"%%\r\nx = 'x = [2,5; 5,5; 4,3];';\r\ny_correct = 'y = [2.5; 5.5; 4.3];';\r\nassert(isequal(translate(x),y_correct))\r\n\r\n%%\r\nx = 'x = [2,25; 5,35; 4,13];';\r\ny_correct = 'y = [2.25; 5.35; 4.13];';\r\nassert(isequal(translate(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":57323,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":"2021-08-12T17:40:06.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T15:05:46.000Z","updated_at":"2026-05-29T01:26:30.000Z","published_at":"2016-10-07T15:05: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\u003eThe string 'x = [2,5; 5,5; 4,3];' should return 'y = [2.5; 5.5; 4.3];'\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":2395,"title":"Simple Past of Regular Verbs","description":"Given a regular verb, return the simple past.\r\n\r\nExample\r\n\r\n Input verb = 'to work'\r\n Output simple_past = 'worked'","description_html":"\u003cp\u003eGiven a regular verb, return the simple past.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e Input verb = 'to work'\r\n Output simple_past = 'worked'\u003c/pre\u003e","function_template":"function simple_past = regverb2simplepast(verb)\r\n  simple_past = verb;\r\nend","test_suite":"%%\r\nx = 'to work';\r\ny_correct = 'worked';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to push';\r\ny_correct = 'pushed';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to use';\r\ny_correct = 'used';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to arrive';\r\ny_correct = 'arrived';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to stop';\r\ny_correct = 'stopped';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to prefer';\r\ny_correct = 'preferred';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to discover';\r\ny_correct = 'discovered';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to mix';\r\ny_correct = 'mixed';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to carry';\r\ny_correct = 'carried';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to rely';\r\ny_correct = 'relied';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to dry';\r\ny_correct = 'dried';\r\nassert(isequal(regverb2simplepast(x),y_correct))\r\n%%\r\nx = 'to play';\r\ny_correct = 'played';\r\nassert(isequal(regverb2simplepast(x),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":4,"created_by":27228,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":25,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-29T13:20:41.000Z","updated_at":"2026-07-23T11:42:42.000Z","published_at":"2014-06-29T13:26:04.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 regular verb, return the simple past.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ Input verb = 'to work'\\n Output simple_past = 'worked']]\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":518,"title":"English to Pig Latin Translator","description":"Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin):\r\n\r\n1. In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and \"ay\" is added, as in the following examples:\r\n\r\n* happy → appy-hay\r\n* question → estion-quay\r\n\r\n2. In words that begin with vowels, the syllable \"ay\" is simply added to the end of the word.\r\n\r\n* another → another-ay\r\n* about → about-ay\r\n\r\nA hyphen is sometimes used to facilitate translation back into English. Ayspray, for instance, is ambiguous, but ay-spray means \"spray\" whereas ays-pray means \"prays.\"\r\n\r\nGiven a string in english (may be multiple words), produce the Pig Latin version.","description_html":"\u003cp\u003ePig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin):\u003c/p\u003e\u003cp\u003e1. In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and \"ay\" is added, as in the following examples:\u003c/p\u003e\u003cul\u003e\u003cli\u003ehappy → appy-hay\u003c/li\u003e\u003cli\u003equestion → estion-quay\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e2. In words that begin with vowels, the syllable \"ay\" is simply added to the end of the word.\u003c/p\u003e\u003cul\u003e\u003cli\u003eanother → another-ay\u003c/li\u003e\u003cli\u003eabout → about-ay\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eA hyphen is sometimes used to facilitate translation back into English. Ayspray, for instance, is ambiguous, but ay-spray means \"spray\" whereas ays-pray means \"prays.\"\u003c/p\u003e\u003cp\u003eGiven a string in english (may be multiple words), produce the Pig Latin version.\u003c/p\u003e","function_template":"function p = english2piglatin( e )\r\n  p = e;\r\nend","test_suite":"%%\r\nstr1 = 'question';\r\nstr2 = 'estion-quay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'another';\r\nstr2 = 'another-ay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'nix';\r\nstr2 = 'ix-nay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'another one bites the dust';\r\nstr2 = 'another-ay one-ay ites-bay e-thay ust-day';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'how much wood would a woodchuck chuck if a woodchuck could chuck wood';\r\nstr2 = 'ow-hay uch-may ood-way ould-way a-ay oodchuck-way uck-chay if-ay a-ay oodchuck-way ould-cay uck-chay ood-way';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'peter piper picked a peck of pickle peppers';\r\nstr2 = 'eter-pay iper-pay icked-pay a-ay eck-pay of-ay ickle-pay eppers-pay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))\r\n\r\n%%\r\nstr1 = 'four score';\r\nstr2 = 'our-fay ore-scay';\r\nstr1_f = english2piglatin(str1);\r\nassert(strcmp(str1_f,str2))","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":164,"test_suite_updated_at":"2016-12-12T17:54:21.000Z","rescore_all_solutions":false,"group_id":14,"created_at":"2012-03-22T14:56:07.000Z","updated_at":"2026-07-15T14:28:57.000Z","published_at":"2012-03-22T15:02:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin):\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\u003e1. In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and \\\"ay\\\" is added, as in the following examples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ehappy → appy-hay\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003equestion → estion-quay\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\u003e2. In words that begin with vowels, the syllable \\\"ay\\\" is simply added to the end of the word.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eanother → another-ay\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eabout → about-ay\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA hyphen is sometimes used to facilitate translation back into English. Ayspray, for instance, is ambiguous, but ay-spray means \\\"spray\\\" whereas ays-pray means \\\"prays.\\\"\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\u003eGiven a string in english (may be multiple words), produce the Pig Latin version.\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\"}]}"}],"errors":[],"facets":[[{"value":"Strings I","count":1,"selected":false}],[{"value":"medium","count":2,"selected":false},{"value":"easy","count":1,"selected":false}]],"term":"tag:\"english\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}