{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-05-26T00:16:20.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-05-26T00: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":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":162,"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-05-05T17:11:17.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":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":162,"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-05-05T17:11:17.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":1,"selected":false}]],"term":"tag:\"translating\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}