{"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":43280,"title":"Replace x value into y value in string text.","description":"Replace x value into y value in string text. Example text='Hello World' x='World', y='Universe' result='Hello Universe'.","description_html":"\u003cp\u003eReplace x value into y value in string text. Example text='Hello World' x='World', y='Universe' result='Hello Universe'.\u003c/p\u003e","function_template":"function y = Replace(text,x,y)\r\n  text = x-y;\r\nend","test_suite":"%%\r\ntext='Hello World';\r\nx='World';\r\ny='Universe';\r\ny_correct = 'Hello Universe';\r\nassert(isequal(Replace(text,x,y),y_correct))\r\n%%\r\ntext='A woman is in the Bahamas. She visits a dolphin encounter. She drops her phone in the water. A dolphin finds the phone. It brings it back to the woman. Unfortunately, the phone is already dead. Difficult words: dolphin encounter (when you get to visit a dolphin), drop (to let something fall by accident), unfortunately (sadly).'\r\nx='dolphin';\r\ny='whale';\r\ny_correct = 'A woman is in the Bahamas. She visits a whale encounter. She drops her phone in the water. A whale finds the phone. It brings it back to the woman. Unfortunately, the phone is already dead. Difficult words: whale encounter (when you get to visit a whale), drop (to let something fall by accident), unfortunately (sadly).';\r\nassert(isequal(Replace(text,x,y),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":80,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T13:02:49.000Z","updated_at":"2026-02-05T08:29:07.000Z","published_at":"2016-10-09T13:02:49.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\u003eReplace x value into y value in string text. Example text='Hello World' x='World', y='Universe' result='Hello Universe'.\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":44294,"title":"Simple String Concatenation","description":"This is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.","description_html":"\u003cp\u003eThis is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.\u003c/p\u003e","function_template":"function concat_str = your_fcn_name(str1, str2)\r\n  concat_str = ...;\r\nend","test_suite":"%%\r\nstr1 = 'apple';\r\nstr2 = 'pear';\r\nconcat_str = 'apple pear';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one';\r\nstr2 = 'two';\r\nconcat_str = 'one two';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one two';\r\nstr2 = 'three four';\r\nconcat_str = 'one two three four';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'hello';\r\nstr2 = 'there';\r\nconcat_str = 'hello there';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'This is half a sentence;';\r\nstr2 = 'here is the other half.';\r\nconcat_str = 'This is half a sentence; here is the other half.';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'left';\r\nstr2 = 'right';\r\nconcat_str = 'left right';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'right';\r\nstr2 = 'left';\r\nconcat_str = 'right left';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = ' leading space';\r\nstr2 = 'trailing space ';\r\nconcat_str = ' leading space trailing space ';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = '123';\r\nstr2 = '456';\r\nconcat_str = '123 456';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":86,"test_suite_updated_at":"2017-09-08T19:18:15.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:32:01.000Z","updated_at":"2026-03-02T17:19:15.000Z","published_at":"2017-09-06T00:32:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eThis is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.\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":44295,"title":"More Simple String Concatenation","description":"Take the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.","description_html":"\u003cp\u003eTake the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.\u003c/p\u003e","function_template":"function concat_str = your_fcn_name(str1, str2)\r\n  concat_str = ...;\r\nend","test_suite":"%%\r\nstr1 = 'apple';\r\nstr2 = 'pear';\r\nconcat_str = 'elppa pear';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one';\r\nstr2 = 'two';\r\nconcat_str = 'eno two';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one two';\r\nstr2 = 'three four';\r\nconcat_str = 'owt eno three four';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'hello';\r\nstr2 = 'there';\r\nconcat_str = 'olleh there';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'This is half a sentence;';\r\nstr2 = 'here is the other half.';\r\nconcat_str = ';ecnetnes a flah si sihT here is the other half.';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'left';\r\nstr2 = 'right';\r\nconcat_str = 'tfel right';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'right';\r\nstr2 = 'left';\r\nconcat_str = 'thgir left';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = ' leading space';\r\nstr2 = 'trailing space ';\r\nconcat_str = 'ecaps gnidael  trailing space ';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = '123';\r\nstr2 = '456';\r\nconcat_str = '321 456';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":76,"test_suite_updated_at":"2017-09-08T19:22:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:35:50.000Z","updated_at":"2026-03-02T17:20:07.000Z","published_at":"2017-09-06T00:35:50.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 the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.\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":43232,"title":"Count me in","description":"Count the number of occurrences of the second input in the first input\r\n\r\nEx. \r\n\r\n    x1 = 12344455511; x2 =2; output = 1\r\n\r\n    x1 = 12344455511; x2 =1; output = 3","description_html":"\u003cp\u003eCount the number of occurrences of the second input in the first input\u003c/p\u003e\u003cp\u003eEx.\u003c/p\u003e\u003cpre\u003e    x1 = 12344455511; x2 =2; output = 1\u003c/pre\u003e\u003cpre\u003e    x1 = 12344455511; x2 =1; output = 3\u003c/pre\u003e","function_template":"function y = countMeIn(a,b)\r\n  y = b;\r\nend","test_suite":"%%\r\na = 1234455611;\r\nb = 2;\r\ny_correct = 1;\r\nassert(isequal(countMeIn(a,b),y_correct))\r\n%%\r\na = 1234455611;\r\nb = 1\r\ny_correct = 3;\r\nassert(isequal(countMeIn(a,b),y_correct))\r\n%%\r\na = 1234455611;\r\nb = 4\r\ny_correct = 2;\r\nassert(isequal(countMeIn(a,b),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":0,"created_by":13865,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":92,"test_suite_updated_at":"2016-10-29T16:32:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T15:55:13.000Z","updated_at":"2026-02-20T13:29:39.000Z","published_at":"2016-10-08T15:56:54.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCount the number of occurrences of the second input in the first input\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\u003eEx.\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[    x1 = 12344455511; x2 =2; output = 1\\n\\n    x1 = 12344455511; x2 =1; output = 3]]\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":42592,"title":"Create cell array of strings","description":"Convert the input to a cell array, but only if necessary.\r\n\r\nIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.","description_html":"\u003cp\u003eConvert the input to a cell array, but only if necessary.\u003c/p\u003e\u003cp\u003eIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.\u003c/p\u003e","function_template":"function C = str2cell(S)\r\n  C = '';\r\nend","test_suite":"%%\r\nS = 'Testing, testing, 1, 2, 3';\r\nassert(isequal(str2cell(S),{S}))\r\n\r\n%%\r\nS = {'I','love','MATLAB'};\r\nassert(isequal(str2cell(S),S))\r\n\r\n%%\r\nS = datestr(now);\r\nassert(isequal(str2cell(S),{S}))\r\n\r\n%%\r\nfor ii=1:100\r\n  S = char(randi([97,122],1,100));\r\n  assert(isequal(str2cell(S),{S}))\r\nend\r\n\r\n%%\r\nfor ii=1:100\r\n  S = num2cell(char(randi([97,122],100,1)));\r\n  assert(isequal(str2cell(S),S))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-09T21:15:00.000Z","updated_at":"2026-02-17T08:36:16.000Z","published_at":"2015-09-09T21:15: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\",\"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\u003eConvert the input to a cell array, but only if necessary.\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 the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.\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":44297,"title":"Automatic String Editing","description":"In this function, you will take an incoming string, and output the same string with each character one letter later in the alphabet (i.e. 'abcd' becomes 'bcde', etc). \r\n\r\nThis function will only take undercase letters from a-y","description_html":"\u003cp\u003eIn this function, you will take an incoming string, and output the same string with each character one letter later in the alphabet (i.e. 'abcd' becomes 'bcde', etc).\u003c/p\u003e\u003cp\u003eThis function will only take undercase letters from a-y\u003c/p\u003e","function_template":"function str2 = your_fcn_name(str1)\r\n  str2 = ...;\r\nend","test_suite":"%%\r\nstr1 = 'abcd';\r\nstr2 = 'bcde';\r\nassert(isequal(your_fcn_name(str1),str2))\r\n\r\n%%\r\nstr1 = 'aeiou';\r\nstr2 = 'bfjpv';\r\nassert(isequal(your_fcn_name(str1),str2))\r\n\r\n%%\r\nstr1 = 'hello';\r\nstr2 = 'ifmmp';\r\nassert(isequal(your_fcn_name(str1),str2))\r\n\r\n%%\r\nstr1 = 'bncdcvnqc';\r\nstr2 = 'codedword';\r\nassert(isequal(your_fcn_name(str1),str2))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":72,"test_suite_updated_at":"2017-09-08T19:26:37.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T01:03:16.000Z","updated_at":"2026-02-17T14:05:38.000Z","published_at":"2017-09-06T01:03:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn this function, you will take an incoming string, and output the same string with each character one letter later in the alphabet (i.e. 'abcd' becomes 'bcde', etc).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis function will only take undercase letters from a-y\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":44620,"title":"generate capital english alphabets ","description":"Based on the numeric input 'n', generate the capital english alphabet starting from A till the english alphabet at the 'n'th position.\r\n\r\nEx: if n=3, generate 'ABC'","description_html":"\u003cp\u003eBased on the numeric input 'n', generate the capital english alphabet starting from A till the english alphabet at the 'n'th position.\u003c/p\u003e\u003cp\u003eEx: if n=3, generate 'ABC'\u003c/p\u003e","function_template":"function letters = generate_alphabets(n)\r\n letters = [];\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 'A';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 6;\r\ny_correct = 'ABCDEF';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 26;\r\ny_correct = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 12;\r\ny_correct = 'ABCDEFGHIJKL';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 21;\r\ny_correct = 'ABCDEFGHIJKLMNOPQRSTU';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 3;\r\ny_correct = 'ABC';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2018-07-16T17:02:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-20T08:51:49.000Z","updated_at":"2026-03-02T08:58:15.000Z","published_at":"2018-04-20T08:51:49.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\u003eBased on the numeric input 'n', generate the capital english alphabet starting from A till the english alphabet at the 'n'th position.\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\u003eEx: if n=3, generate 'ABC'\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":44548,"title":"ASCII sum of phrases","description":"Find the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array:\r\n[77   121    32   110    97   109   101    32   105   115    32   116   101   115   116] i.e. 1379","description_html":"\u003cp\u003eFind the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array:\r\n[77   121    32   110    97   109   101    32   105   115    32   116   101   115   116] i.e. 1379\u003c/p\u003e","function_template":"function y = str_to_number(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'Tilda : ~';\r\ny_correct = 742;\r\nassert(isequal(str_to_number(x),742))\r\n%%\r\nx = 'Practise more';\r\ny_correct = 1294;\r\nassert(isequal(str_to_number(x),1294))\r\n%%\r\nx = '1 last test';\r\ny_correct = 997;\r\nassert(isequal(str_to_number(x),997))\r\n%%\r\nx = 'OK, Definitely the last!';\r\ny_correct = 997;\r\nassert(isequal(str_to_number(x),2121))","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":50,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-02T16:01:56.000Z","updated_at":"2026-03-02T09:04:48.000Z","published_at":"2018-04-02T16:01: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 the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array: [77 121 32 110 97 109 101 32 105 115 32 116 101 115 116] i.e. 1379\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":44662,"title":"Check if there are white spaces in the input string","description":"If there are white spaces in the input string, output=1 else 0","description_html":"\u003cp\u003eIf there are white spaces in the input string, output=1 else 0\u003c/p\u003e","function_template":"function y = white_space_tf(x)\r\n  \r\nend","test_suite":"%%\r\nx = '123 test';\r\ny_correct = 1;\r\nassert(isequal(white_space_tf(x),y_correct))\r\n\r\n%%\r\nx = '123';\r\ny_correct = 0;\r\nassert(isequal(white_space_tf(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T14:24:57.000Z","updated_at":"2026-03-05T10:45:19.000Z","published_at":"2018-05-29T14:24:57.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\u003eIf there are white spaces in the input string, output=1 else 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":60699,"title":"Palindrome Checker","description":"Check to see if a given string is a palindrome (a word, phrase, or sequence that reads the same backward as forward).\r\nOutput should be true or false!\r\n*Bonus points (*imaginary) for code that checks each element in a given string array","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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: 366.8px 8px; transform-origin: 366.8px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCheck to see if a given string is a palindrome (a word, phrase, or sequence that reads the same backward as forward).\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-collapse: preserve; 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: 94.125px 8px; transform-origin: 94.125px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOutput should be true or false!\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-collapse: preserve; 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: 43.1833px 8px; transform-origin: 43.1833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e*Bonus points\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 41.625px 8px; transform-origin: 41.625px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e (*imaginary) \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 175.425px 8px; transform-origin: 175.425px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003efor code that checks each element in a given string array\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function s = pal_check(x)\r\n  s = false;\r\nend","test_suite":"%%\r\nx = \"hello\";\r\ns = false;\r\nassert(isequal(pal_check(x),s))\r\n%%\r\nx = \"madam\";\r\ns = true;\r\nassert(isequal(pal_check(x),s))\r\n%%\r\nx = \"level\";\r\ns = true;\r\nassert(isequal(pal_check(x),s))\r\n%%\r\nx = \"matlab\";\r\ns = false;\r\nassert(isequal(pal_check(x),s))\r\n%%\r\nx = \"saippuakivikauppias\";\r\ns = true;\r\nassert(isequal(pal_check(x),s))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":4585291,"edited_by":4585291,"edited_at":"2024-08-07T15:53:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":31,"test_suite_updated_at":"2024-08-07T15:53:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2024-08-07T15:46:41.000Z","updated_at":"2026-02-19T15:43:02.000Z","published_at":"2024-08-07T15:53:41.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCheck to see if a given string is a palindrome (a word, phrase, or sequence that reads the same backward as forward).\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\u003eOutput should be true or 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003e*Bonus points\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e (*imaginary) \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003efor code that checks each element in a given string array\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":1741,"title":"Numeric array to cell array of strings (easy)","description":"Given a numeric array (A) and a 1xk cell array of strings (C), return a cell array (B) that is the same size as A and in which each element of B is the string in C indexed by the same element in A.\r\n\r\nYou may assume that every element of A is an integer on the interval [1,k].\r\n\r\n*Example*\r\n\r\nIf\r\n\r\n  A = [1 2 3\r\n       2 3 1\r\n       3 1 2];\r\n  C = {'yes','no','maybe'};\r\n\r\nThen\r\n\r\n  B = {'yes'    'no'     'maybe'\r\n       'no'     'maybe'  'yes'\r\n       'maybe'  'yes'    'no'};","description_html":"\u003cp\u003eGiven a numeric array (A) and a 1xk cell array of strings (C), return a cell array (B) that is the same size as A and in which each element of B is the string in C indexed by the same element in A.\u003c/p\u003e\u003cp\u003eYou may assume that every element of A is an integer on the interval [1,k].\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3\r\n     2 3 1\r\n     3 1 2];\r\nC = {'yes','no','maybe'};\r\n\u003c/pre\u003e\u003cp\u003eThen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eB = {'yes'    'no'     'maybe'\r\n     'no'     'maybe'  'yes'\r\n     'maybe'  'yes'    'no'};\r\n\u003c/pre\u003e","function_template":"function B = ind2str(A,C)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [1 2 3\r\n     2 3 1\r\n     3 1 2];\r\nC = {'yes','no','maybe'};\r\nB_correct = {'yes'    'no'     'maybe'\r\n             'no'     'maybe'  'yes'\r\n             'maybe'  'yes'    'no'};\r\nassert(isequal(ind2str(A,C),B_correct))\r\n\r\n%%\r\nA = ones(20,1);\r\nC = {'apples','oranges'};\r\nassert(all(strcmp(ind2str(A,C),'apples')))\r\n\r\n%%\r\nA = randi(1000,[22,10]);\r\nC = arrayfun(@(x) num2str(x),1:1000,'uni',0);\r\nassert(isequal(A,cellfun(@(c) str2num(c),ind2str(A,C))))\r\n\r\n%%\r\nA = randi(2,[1,100]);\r\nC = {'0','1'};\r\nassert(isequal(A-1,cellfun(@(c) str2num(c),ind2str(A,C))))\r\n\r\n%%\r\nA = [2 4 4 2 2 4];\r\nC = {'foo','bar','baz','qux'};\r\nB_correct = {'bar' 'qux' 'qux' 'bar' 'bar' 'qux'};\r\nassert(isequal(ind2str(A,C),B_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-23T17:44:26.000Z","updated_at":"2026-02-27T13:58:55.000Z","published_at":"2013-07-23T17:44:26.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 numeric array (A) and a 1xk cell array of strings (C), return a cell array (B) that is the same size as A and in which each element of B is the string in C indexed by the same element in 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\u003eYou may assume that every element of A is an integer on the interval [1,k].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[A = [1 2 3\\n     2 3 1\\n     3 1 2];\\nC = {'yes','no','maybe'};]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThen\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[B = {'yes'    'no'     'maybe'\\n     'no'     'maybe'  'yes'\\n     'maybe'  'yes'    'no'};]]\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":1230,"title":"Who is the smartest MATLAB programmer?","description":"Who is the smartest MATLAB programmer?\r\n\r\nExamples:\r\n\r\n  Input x = 'Is it Obama?'\r\n  Output = 'Me!'\r\n\r\n  Input x = 'Who ?'\r\n  Output = 'Me!'\r\n\r\nReturn 'Me!' to all inputs. (Note: this is only a joke!)","description_html":"\u003cp\u003eWho is the smartest MATLAB programmer?\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput x = 'Is it Obama?'\r\nOutput = 'Me!'\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eInput x = 'Who ?'\r\nOutput = 'Me!'\r\n\u003c/pre\u003e\u003cp\u003eReturn 'Me!' to all inputs. (Note: this is only a joke!)\u003c/p\u003e","function_template":"function y = smartest(x)\r\n  y = 'Not me!';\r\nend","test_suite":"%%\r\nx = 'I have been using MATLAB for 50 years!';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = 'I developed MATLAB!';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = '';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":3,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":791,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-30T01:41:14.000Z","updated_at":"2026-03-18T08:03:59.000Z","published_at":"2013-01-30T01:41:14.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\u003eWho is the smartest MATLAB programmer?\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[Input x = 'Is it Obama?'\\nOutput = 'Me!'\\n\\nInput x = 'Who ?'\\nOutput = 'Me!']]\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\u003eReturn 'Me!' to all inputs. (Note: this is only a joke!)\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":325,"title":"2 b | ~ 2 b","description":"Given a string input, output true if there are 2 b's in it, false if otherwise\r\nExamples:\r\n'Macbeth' -\u003e false 'Publius Cornelius Dolabella' -\u003e true\r\nNote: sometimes it's the littlest things that matter....","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: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 223px 8px; transform-origin: 223px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a string input, output true if there are 2 b's in it, false if otherwise\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: 32px 8px; transform-origin: 32px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eExamples:\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: 170px 8px; transform-origin: 170px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e'Macbeth' -\u0026gt; false 'Publius Cornelius Dolabella' -\u0026gt; true\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: 159px 8px; transform-origin: 159px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: sometimes it's the littlest things that matter....\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = two_b_or_not_two_b(x)\r\n  y = true;\r\nend","test_suite":"%%\r\nx = 'Macbeth';\r\ny_correct = false;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))\r\n\r\n%%\r\nx = 'Publius Cornelius Dolabella';\r\ny_correct = true;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))\r\n\r\n%%\r\nx = 'B is not the same as b';\r\ny_correct = true;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))\r\n\r\n%%\r\nx = 'Boba fett is a Star Wars character';\r\ny_correct = true;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))\r\n\r\n%%\r\nx = 'I''m buying a Balloon and going in a bus';\r\ny_correct = false;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":8,"created_by":1022,"edited_by":223089,"edited_at":"2023-03-02T14:13:24.000Z","deleted_by":null,"deleted_at":null,"solvers_count":410,"test_suite_updated_at":"2023-03-02T14:13:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-16T05:20:41.000Z","updated_at":"2026-02-20T14:35:25.000Z","published_at":"2012-02-16T05:20:41.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a string input, output true if there are 2 b's in it, false if otherwise\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\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e'Macbeth' -\u0026gt; false 'Publius Cornelius Dolabella' -\u0026gt; true\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: sometimes it's the littlest things that matter....\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":2946,"title":"Where is she?","description":"Given the numbers 12, 3, 6, 9 \r\n\r\nTell where the girl is located. That is:\r\n\r\nLook to your 3 o'clock = look right\r\n\r\nExample\r\n\r\n x = 3\r\n\r\n fprintf('Look Right \\n')","description_html":"\u003cp\u003eGiven the numbers 12, 3, 6, 9\u003c/p\u003e\u003cp\u003eTell where the girl is located. That is:\u003c/p\u003e\u003cp\u003eLook to your 3 o'clock = look right\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e x = 3\u003c/pre\u003e\u003cpre\u003e fprintf('Look Right \\n')\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 12;\r\ny_correct = 'Look Up';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 'Look Right';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 6;\r\ny_correct = 'Look Back';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 9;\r\ny_correct = 'Look Left';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":33703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":115,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-04T18:44:59.000Z","updated_at":"2026-02-18T10:54:39.000Z","published_at":"2015-02-04T18:44:59.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the numbers 12, 3, 6, 9\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\u003eTell where the girl is located. That is:\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\u003eLook to your 3 o'clock = look right\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[ x = 3\\n\\n fprintf('Look Right \\\\n')]]\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":2688,"title":"Keep Only the Upper characters in a string ","description":"Keep Only the Upper characters in a string \r\n\r\ns = 'Sreeram Mohan'; \r\n\r\noutput = SM;\r\n","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 134.5px 8px; transform-origin: 134.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eKeep Only the Upper characters in a string\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: 67px 8px; transform-origin: 67px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003es = 'Sreeram Mohan';\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: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eoutput = SM;\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%WEAR A MASK AND STAY HOME\r\nend","test_suite":"%%\r\nx = 'Stay Home, Stay Safe!';\r\ny_correct = 'SHSS';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'Sreeram Mohan';\r\ny_correct = 'SM';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'North Carolina';\r\ny_correct = 'NC';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'The Quick Brown Fox jumps over the Lazy Dog';\r\ny_correct = 'TQBFLD';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'guitars are cool';\r\nassert(isempty(your_fcn_name(x)))\r\n\r\n%%\r\nx = 'I AM BATMAN';\r\ny_correct = 'IAMBATMAN';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'I have the high ground';\r\ny_correct = 'I';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'JUMbled leTTer$ anD NUMBers';\r\ny_correct = 'JUMTTDNUMB'\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'COVID19';\r\ny_correct = 'COVID';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'The name’s Bond. James Bond.';\r\ny_correct = 'TBJB';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'football is a sport';\r\nassert(isempty(your_fcn_name(x)))\r\n\r\n%%\r\nx = 'The Sun IS a staR';\r\ny_correct = 'TSISR';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'National Aeonautics and Space Administration';\r\ny_correct = 'NASA';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'ThIs QuItE a RaNdOm SeNtEnCe';\r\ny_correct = 'TIQIERNOSNEC';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":3946,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2021-05-08T05:47:36.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-11-24T12:00:27.000Z","updated_at":"2026-03-04T16:08:37.000Z","published_at":"2014-11-24T12:00:27.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\u003eKeep Only the Upper characters in a string\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\u003es = 'Sreeram Mohan';\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\u003eoutput = SM;\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":1271,"title":"THE CALCULATOR OF LOVE","description":"In honor of Valentine's Day, program a love calculator that figures out the percentage of compatibility between two people using their names! The algorithm should be as follows:\r\n\r\n* Compile the unique characters of both names\r\n* Sum their ASCII values\r\n* Divide by 101\r\n* The remainder is the match percentage!\r\n\r\nEnjoy! And may cupid have mercy on your love life.","description_html":"\u003cp\u003eIn honor of Valentine's Day, program a love calculator that figures out the percentage of compatibility between two people using their names! The algorithm should be as follows:\u003c/p\u003e\u003cul\u003e\u003cli\u003eCompile the unique characters of both names\u003c/li\u003e\u003cli\u003eSum their ASCII values\u003c/li\u003e\u003cli\u003eDivide by 101\u003c/li\u003e\u003cli\u003eThe remainder is the match percentage!\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eEnjoy! And may cupid have mercy on your love life.\u003c/p\u003e","function_template":"function score = love_calculator(name1, name2)\r\n  score = [name1 name2];\r\nend","test_suite":"%%\r\nassert(love_calculator('Jay-Z','Beyonce')==5)\r\n\r\n%%\r\nassert(love_calculator('Dr. Dre','Eminem')==47)\r\n\r\n%%\r\nassert(love_calculator('Angelina Jolie','Brad Pitt')==69)\r\n\r\n%%\r\nassert(love_calculator('Jennifer Aniston','Brad Pitt')==75)\r\n\r\n%%\r\nassert(love_calculator('God','Satan')==82)\r\n\r\n%%\r\nassert(love_calculator('Your Mom','Your Dad')==5)\r\n\r\n%%\r\nassert(love_calculator('@bmtran','MATLAB')==66)\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":86,"test_suite_updated_at":"2013-02-14T19:15:26.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-14T19:05:06.000Z","updated_at":"2026-03-04T16:10:15.000Z","published_at":"2013-02-14T19:12: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn honor of Valentine's Day, program a love calculator that figures out the percentage of compatibility between two people using their names! The algorithm should be as follows:\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\u003eCompile the unique characters of both names\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\u003eSum their ASCII values\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\u003eDivide by 101\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe remainder is the match percentage!\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\u003eEnjoy! And may cupid have mercy on your love life.\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":1191,"title":"Will there be a new leader?","description":"Simply answer the title.","description_html":"\u003cp\u003eSimply answer the title.\u003c/p\u003e","function_template":"function y = wholeads(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx=1\r\ny_correct = 'depends';\r\nassert(isequal(wholeads(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":9554,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":376,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-09T20:38:07.000Z","updated_at":"2026-03-29T19:46:06.000Z","published_at":"2013-01-09T20:38:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eSimply answer the title.\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":2475,"title":"Case-insensitive Character Detection","description":"Find the index of a particular character in a string ignoring case.\r\n\r\nExample\r\n\r\n Input:   x = 'aAbhhfdf'\r\n          n = 'a'\r\n\r\n Output:  1 2\r\n\r\nBecause in x, at position 1 and 2 , we have a (ignoring case)","description_html":"\u003cp\u003eFind the index of a particular character in a string ignoring case.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e Input:   x = 'aAbhhfdf'\r\n          n = 'a'\u003c/pre\u003e\u003cpre\u003e Output:  1 2\u003c/pre\u003e\u003cp\u003eBecause in x, at position 1 and 2 , we have a (ignoring case)\u003c/p\u003e","function_template":"function y = indexString(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx='aAbhhfdf';\r\nn='a';\r\ny_correct = [1 2];\r\nassert(isequal(indexString(x,n),y_correct))\r\n\r\n%%\r\nx='IndiA';\r\nn='a';\r\ny_correct = [5];\r\nassert(isequal(indexString(x,n),y_correct));\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":63,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-07-31T13:32:09.000Z","updated_at":"2026-03-17T07:52:06.000Z","published_at":"2014-07-31T13:32: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the index of a particular character in a string ignoring case.\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:   x = 'aAbhhfdf'\\n          n = 'a'\\n\\n Output:  1 2]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBecause in x, at position 1 and 2 , we have a (ignoring case)\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":2625,"title":"Shorten pathname","description":"Given a pathname string, return a condensed version by replacing intermediate folders with '..'.\r\n\r\n*Example*\r\n\r\nIf\r\n\r\n  fullpath = 'C:\\foo\\bar\\baz\\qux';\r\n\r\nthen\r\n\r\n  shortpath = 'C:\\..\\qux';","description_html":"\u003cp\u003eGiven a pathname string, return a condensed version by replacing intermediate folders with '..'.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003efullpath = 'C:\\foo\\bar\\baz\\qux';\r\n\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eshortpath = 'C:\\..\\qux';\r\n\u003c/pre\u003e","function_template":"function y = shorten(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'C:\\foo\\bar\\baz\\qux';\r\nassert(isequal(shorten(x),'C:\\..\\qux'))\r\n\r\n%%\r\nx = 'this\\is\\just\\a\\test';\r\nassert(isequal(shorten(x),'this\\..\\test'))\r\n\r\n%%\r\nx = 'testing\\testing\\123.mat';\r\nassert(isequal(shorten(x),'testing\\..\\123.mat'))\r\n\r\n%%\r\nx = 'testing\\t1\\t2\\t3\\t4\\t5\\t6\\t7\\t8\\t9\\t10\\123.mat';\r\nassert(isequal(shorten(x),'testing\\..\\123.mat'))\r\n\r\n%%\r\nx = 'corp.company_name.com\\dir1\\dir2\\dir3\\dir4\\file';\r\nassert(isequal(shorten(x),'corp.company_name.com\\..\\file'))\r\n\r\n%%\r\nx = 'dir1\\dir2\\dir3\\d.txt';\r\nassert(isequal(shorten(x),'dir1\\..\\d.txt'))\r\n\r\n%%\r\nx = 'dir1\\dir#2\\dir_3\\dir%4\\dir(5)\\dir+6\\d.txt';\r\nassert(isequal(shorten(x),'dir1\\..\\d.txt'))","published":true,"deleted":false,"likes_count":5,"comments_count":1,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":92,"test_suite_updated_at":"2017-09-27T16:08:09.000Z","rescore_all_solutions":false,"group_id":32,"created_at":"2014-10-11T04:40:47.000Z","updated_at":"2026-03-19T19:57:55.000Z","published_at":"2014-10-11T04:40:47.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 pathname string, return a condensed version by replacing intermediate folders with '..'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[fullpath = 'C:\\\\foo\\\\bar\\\\baz\\\\qux';]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[shortpath = 'C:\\\\..\\\\qux';]]\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":42421,"title":"Reverse a string","description":"Reverse the given string.\r\n\r\nExample\r\n\r\n input  = 'reverse'\r\n output = 'esrever'","description_html":"\u003cp\u003eReverse the given string.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e input  = 'reverse'\r\n output = 'esrever'\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'gadag';\r\ny_correct = 'gadag';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'gadaga';\r\ny_correct = 'agadag';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'once upon a yraerd thgindim';\r\ny_correct = 'midnight dreary a nopu ecno';\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":5,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":216,"test_suite_updated_at":"2015-07-15T17:11:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-06-26T06:16:21.000Z","updated_at":"2026-02-18T14:23:45.000Z","published_at":"2015-06-26T06:16:21.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\u003eReverse the given string.\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  = 'reverse'\\n output = 'esrever']]\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":44619,"title":"Capitalized string operations","description":"Convert the input sentence to upper case and replace all vowels with an underscore ('_') ","description_html":"\u003cp\u003eConvert the input sentence to upper case and replace all vowels with an underscore ('_')\u003c/p\u003e","function_template":"function y = upper_replace(Documents)\r\n  y = x;\r\nend","test_suite":"%%\r\nDocuments = 'These are sample tests on a sentence';\r\ny_correct = 'TH_S_ _R_ S_MPL_ T_STS _N _ S_NT_NC_';\r\nassert(isequal(upper_replace(Documents),y_correct))\r\n\r\n%%\r\nDocuments = 'This is an underscore: _';\r\ny_correct = 'TH_S _S _N _ND_RSC_R_: _';\r\nassert(isequal(upper_replace(Documents),y_correct))","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":51,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-20T06:13:50.000Z","updated_at":"2026-03-17T11:42:25.000Z","published_at":"2018-04-20T06:13:50.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\u003eConvert the input sentence to upper case and replace all vowels with an underscore ('_')\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":1461,"title":"Duplicate a character ","description":"Duplicate a character 'n' times.\r\n\r\nExample 1: str='a' n=5\r\n\r\noutput='aaaaa'\r\n\r\nExample 2: str='*' n=3\r\n\r\noutput='***'\r\n\r\n","description_html":"\u003cp\u003eDuplicate a character 'n' times.\u003c/p\u003e\u003cp\u003eExample 1: str='a' n=5\u003c/p\u003e\u003cp\u003eoutput='aaaaa'\u003c/p\u003e\u003cp\u003eExample 2: str='*' n=3\u003c/p\u003e\u003cp\u003eoutput='***'\u003c/p\u003e","function_template":"function y = duplicate_char(str,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nstr = 'b';n=5\r\ny_correct = 'bbbbb';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n\r\n%%\r\nstr = 's';n=1\r\ny_correct = 's';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n\r\n%%\r\nstr = 'b';n=10\r\ny_correct = 'bbbbbbbbbb';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n\r\n%%\r\nstr = 'b';n=0\r\ny_correct = '';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n%%\r\nstr = '?';n=2\r\ny_correct = '??';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":1023,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":245,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-04-26T01:35:19.000Z","updated_at":"2026-02-18T15:15:38.000Z","published_at":"2013-04-26T01:35: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\",\"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\u003eDuplicate a character 'n' times.\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 1: str='a' n=5\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\u003eoutput='aaaaa'\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 2: str='*' n=3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput='***'\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":44296,"title":"String Delimination and Outputting","description":"In this problem, take an incoming string and deliminate the string based on spaces. Output the first string in between the spaces (i.e. 'apple pear' becomes 'apple' 'pear' for str output 1 and 2, final output is 'apple')","description_html":"\u003cp\u003eIn this problem, take an incoming string and deliminate the string based on spaces. Output the first string in between the spaces (i.e. 'apple pear' becomes 'apple' 'pear' for str output 1 and 2, final output is 'apple')\u003c/p\u003e","function_template":"function [str1, str2] = your_fcn_name(delim_str)\r\n  str1 = ...;\r\n  str2 = ...;\r\nend","test_suite":"%%\r\ndelim_str = 'apple pear';\r\nstr1 = 'apple';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = 'apple pear pineapple';\r\nstr1 = 'apple';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = 'one';\r\nstr1 = 'one';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = 'one two three';\r\nstr1 = 'one';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = '123 456';\r\nstr1 = '123';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = '123456';\r\nstr1 = '123456';\r\nassert(isequal(your_fcn_name(delim_str),str1))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":64,"test_suite_updated_at":"2017-09-08T19:24:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:56:06.000Z","updated_at":"2026-03-16T10:06:15.000Z","published_at":"2017-09-06T00:56: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\u003eIn this problem, take an incoming string and deliminate the string based on spaces. Output the first string in between the spaces (i.e. 'apple pear' becomes 'apple' 'pear' for str output 1 and 2, final output is 'apple')\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":44420,"title":"文字列の最初と最後の文字だけ抜き出しましょう。","description":"文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。\r\nもし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\r\n\r\n例:\r\n\r\n   stringfirstandlast('boring example') = 'be'\r\n\r\n* (英語版) Problem 649. Return the first and last character of a string\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/649\u003e\r\n","description_html":"\u003cp\u003e文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。\r\nもし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e   stringfirstandlast('boring example') = 'be'\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 649. Return the first and last character of a string \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/649\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/649\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = stringfirstandlast(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'abcde';\r\ny_correct = 'ae';\r\nassert(isequal(stringfirstandlast(x),y_correct))\r\n%%\t\r\nx = 'a';\r\ny_correct = 'aa';\r\nassert(isequal(stringfirstandlast(x),y_correct))\r\n%%\t\r\nx = 'codyrocks!';\r\ny_correct = 'c!';\r\nassert(isequal(stringfirstandlast(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":348,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-28T06:51:19.000Z","updated_at":"2026-03-16T19:35:37.000Z","published_at":"2017-11-28T06:51: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\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\u003e例:\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[   stringfirstandlast('boring example') = 'be']]\u003e\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\u003e(英語版) Problem 649. Return the first and last character of a string\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/649\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/649\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\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":2143,"title":"reverse string","description":"input='rama'\r\noutput='amar'","description_html":"\u003cp\u003einput='rama'\r\noutput='amar'\u003c/p\u003e","function_template":"function y = rs(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = char([97:1:122]);\r\ny_correct = char([122:-1:97]);\r\nassert(isequal(rs(x),y_correct))\r\n%%\r\nx = 'HOW';\r\ny_correct = 'WOH';\r\nassert(isequal(rs(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1690,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":384,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-01-31T07:15:47.000Z","updated_at":"2026-02-18T14:52:20.000Z","published_at":"2014-01-31T07:15:47.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\u003einput='rama' output='amar'\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":2141,"title":"execute the declaration in strings and return value","description":"execute the commands in strings and return value\r\n\r\ninput='a=23'\r\noutput=23","description_html":"\u003cp\u003eexecute the commands in strings and return value\u003c/p\u003e\u003cp\u003einput='a=23'\r\noutput=23\u003c/p\u003e","function_template":"function y = stringed_commands(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'a=45';\r\ny_correct = 45;\r\nassert(isequal(stringed_commands(x),y_correct))\r\n%%\r\nx = 'a=908';\r\ny_correct = 908;\r\nassert(isequal(stringed_commands(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":1690,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":61,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-01-31T03:11:10.000Z","updated_at":"2026-03-24T12:09:35.000Z","published_at":"2014-01-31T03:11:10.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eexecute the commands in strings and return value\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\u003einput='a=23' output=23\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":45991,"title":"Find the position of planet in solarsystem","description":"Write a funtion named *nthplanet* which takes name of the planet as input string and provides the position of the planet, starting from *Mercury* at *1st* position and *Neptune* at *8th* , as output.(For those who are sad because I ignored Pluto, Pluto is considered as Dwarf planet by IAU)\r\n\r\nIf\r\n\r\n  x = 'Earth'\r\n\r\nthen\r\n\r\n  nthplanet(x)\r\n\r\ngives\r\n\r\n  3\r\n\r\nPlease have a look at the Testsuite before you begin","description_html":"\u003cp\u003eWrite a funtion named \u003cb\u003enthplanet\u003c/b\u003e which takes name of the planet as input string and provides the position of the planet, starting from \u003cb\u003eMercury\u003c/b\u003e at \u003cb\u003e1st\u003c/b\u003e position and \u003cb\u003eNeptune\u003c/b\u003e at \u003cb\u003e8th\u003c/b\u003e , as output.(For those who are sad because I ignored Pluto, Pluto is considered as Dwarf planet by IAU)\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = 'Earth'\r\n\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003enthplanet(x)\r\n\u003c/pre\u003e\u003cp\u003egives\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e3\r\n\u003c/pre\u003e\u003cp\u003ePlease have a look at the Testsuite before you begin\u003c/p\u003e","function_template":"function y = nthplanet(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'earth';\r\ny_correct = 3;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'Neptune';\r\ny_correct = 8;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'MeRcUrY';\r\ny_correct = 1;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'SATURN';\r\ny_correct = 6;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'URAnus';\r\ny_correct = 7;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'MarS';\r\ny_correct = 4;\r\nassert(isequal(nthplanet(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":470183,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":30,"test_suite_updated_at":"2020-06-29T08:54:02.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2020-06-26T07:39:20.000Z","updated_at":"2026-03-31T13:06:22.000Z","published_at":"2020-06-26T07:55: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\u003eWrite a funtion named\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\u003enthplanet\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e which takes name of the planet as input string and provides the position of the planet, starting from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eMercury\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e at\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\u003e1st\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e position 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\u003eNeptune\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e at\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\u003e8th\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , as output.(For those who are sad because I ignored Pluto, Pluto is considered as Dwarf planet by IAU)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x = 'Earth']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[nthplanet(x)]]\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\u003egives\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[3]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease have a look at the Testsuite before you begin\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":2802,"title":"Count number of words in string","description":"Count number of words in string \r\n\r\nExamples\r\n\r\n 'hi', answer is 1\r\n\r\n 'hi hi', answer is 2\r\n\r\n 'I enjoy cody', answer is 3\r\n","description_html":"\u003cp\u003eCount number of words in string\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e 'hi', answer is 1\u003c/pre\u003e\u003cpre\u003e 'hi hi', answer is 2\u003c/pre\u003e\u003cpre\u003e 'I enjoy cody', answer is 3\u003c/pre\u003e","function_template":"function y = word_count(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'hi';\r\ny_correct = 1;\r\nassert(isequal(word_count(x),y_correct))\r\n%%\r\nx = 'hi hi';\r\ny_correct = 2;\r\nassert(isequal(word_count(x),y_correct))\r\n%%\r\nx = 'I love cody';\r\ny_correct = 3;\r\nassert(isequal(word_count(x),y_correct))\r\n%%\r\nx = 'MATHWORK';\r\ny_correct = 1;\r\nassert(isequal(word_count(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":188,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-27T11:22:01.000Z","updated_at":"2026-02-18T15:24:32.000Z","published_at":"2014-12-27T11:22:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCount number of words in string\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[ 'hi', answer is 1\\n\\n 'hi hi', answer is 2\\n\\n 'I enjoy cody', answer is 3]]\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":60694,"title":"Reverse a string","description":"Return a string with the characters in reverse order from a given input string \r\nEx: \r\nmy_str = \"Ciao\"\r\nfunction should output \"oaiC\"","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: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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: 236.1px 8px; transform-origin: 236.1px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReturn a string with the characters in reverse order from a given input string \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-collapse: preserve; 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: 12.05px 8px; transform-origin: 12.05px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEx: \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-collapse: preserve; 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: 48.3417px 8px; transform-origin: 48.3417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003emy_str = \"Ciao\"\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-collapse: preserve; 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: 89.775px 8px; transform-origin: 89.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003efunction should output \"oaiC\"\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = str_opp(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = \"Ciao\";\r\ny_correct = \"oaiC\";\r\nassert(isequal(str_opp(x),y_correct))\r\n%%\r\nx = \"heLLo\";\r\ny_correct = \"oLLeh\";\r\nassert(isequal(str_opp(x),y_correct))\r\n%%\r\nx = [\"MaTlAb\",\"is\",\"fUN\",\"to\",\"work\",\"on\"];\r\ny_correct = [\"bAlTaM\",\"si\",\"NUf\",\"ot\",\"krow\",\"no\"];\r\nassert(isequal(str_opp(x),y_correct))\r\n%%\r\nx = [\"diD\",\"uoY\";\"rehpiceD\",\"sihT\";\"egasseM\",\"?yltcerroC\"];\r\ny_correct = [\"Did\",\"You\";\"Decipher\",\"This\";\"Message\",\"Correctly?\"];\r\nassert(isequal(str_opp(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4585291,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-08-07T15:43:39.000Z","updated_at":"2026-02-17T15:42:01.000Z","published_at":"2024-08-07T15:43:39.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReturn a string with the characters in reverse order from a given input string \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\u003eEx: \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\u003emy_str = \\\"Ciao\\\"\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\u003efunction should output \\\"oaiC\\\"\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":45985,"title":"Flag a convertible string","description":"If a string is able to be entirely converted to an integer, return a \"true\" flag. Otherwise, return a false flag. For example:\r\na = '32';\r\nisconvertible(a)\r\nWould return logical(1)\r\na = '32f';\r\nisconvertible(a)\r\nWould return logical(0)","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: 184.733px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 92.3667px; transform-origin: 407px 92.3667px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 371.5px 8px; transform-origin: 371.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf a string is able to be entirely converted to an integer, return a \"true\" flag. Otherwise, return a false flag. For example:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 40.8667px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 20.4333px; transform-origin: 404px 20.4333px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 36px 8.5px; tab-size: 4; transform-origin: 36px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003ea = \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 16px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 16px 8.5px; \"\u003e'32'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 64px 8.5px; tab-size: 4; transform-origin: 64px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eisconvertible(a)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 72px 8px; transform-origin: 72px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWould return logical(1)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 40.8667px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 20.4333px; transform-origin: 404px 20.4333px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 40px 8.5px; tab-size: 4; transform-origin: 40px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003ea = \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 20px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 20px 8.5px; \"\u003e'32f'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 64px 8.5px; tab-size: 4; transform-origin: 64px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eisconvertible(a)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 72px 8px; transform-origin: 72px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWould return logical(0)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = isconvertible(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = '32';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '-1';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '0';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = 'i';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = 'shoosan3';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '-2';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = 'sdaf';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = 'f00';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = num2str(randi(1e3));\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = sprintf('%d%s%d', randi(9), char(randi([65 90])), randi(9));\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = num2str(pi,4);\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '420';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '$23';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":157354,"edited_by":223089,"edited_at":"2023-04-15T06:05:40.000Z","deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":"2023-04-15T06:05:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-23T22:04:06.000Z","updated_at":"2026-03-04T14:59:45.000Z","published_at":"2020-06-23T22:04:06.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a string is able to be entirely converted to an integer, return a \\\"true\\\" flag. Otherwise, return a false flag. For example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = '32';\\nisconvertible(a)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWould return logical(1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = '32f';\\nisconvertible(a)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWould return logical(0)\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":54500,"title":"Remove Lower Case Letters","description":"Example\r\nMEMOry --\u003e MEMO\r\nIMPlEMeNtATiON --\u003e IMPEMNATON","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: 700; \"\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eMEMOry --\u0026gt; MEMO\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIMPlEMeNtATiON --\u0026gt; IMPEMNATON\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  y = x;\r\nend","test_suite":"%%\r\nx = 'MEMOry';\r\ny_correct = 'MEMO';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'IMPlEMeNtATiON';\r\ny_correct = 'IMPEMNATON';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":232412,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":276,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-05-04T12:45:52.000Z","updated_at":"2026-03-22T01:00:27.000Z","published_at":"2022-05-04T12:45:52.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMEMOry --\u0026gt; MEMO\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\u003eIMPlEMeNtATiON --\u0026gt; IMPEMNATON\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":1862,"title":"Does this dress make me look fat","description":"For the input string \"Does xyz make me look fat\" output the string \"No, xyz does not make you look fat\"","description_html":"\u003cp\u003eFor the input string \"Does xyz make me look fat\" output the string \"No, xyz does not make you look fat\"\u003c/p\u003e","function_template":"function y = fat(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'Does this dress make me look fat';\r\ny_correct = 'No, this dress does not make you look fat';\r\nassert(isequal(fat(x),y_correct))\r\n%%\r\nx = 'Does this shirt make me look fat';\r\ny_correct = 'No, this shirt does not make you look fat';\r\nassert(isequal(fat(x),y_correct))\r\n%%\r\nx = 'Does my hair make me look fat';\r\ny_correct = 'No, my hair does not make you look fat';\r\nassert(isequal(fat(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":7800,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":"2016-05-11T18:55:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-09-06T22:46:07.000Z","updated_at":"2026-03-04T15:31:51.000Z","published_at":"2016-05-11T18:55:41.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 the input string \\\"Does xyz make me look fat\\\" output the string \\\"No, xyz does not make you look fat\\\"\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":409,"title":"Back to basics 19 - character types","description":"Covering some basic topics I haven't seen elsewhere on Cody.\r\n\r\nReturn the number of punctuation characters in the input variable.","description_html":"\u003cp\u003eCovering some basic topics I haven't seen elsewhere on Cody.\u003c/p\u003e\u003cp\u003eReturn the number of punctuation characters in the input variable.\u003c/p\u003e","function_template":"function y = punctuation(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'This is cool!';\r\ny_correct = 1;\r\nassert(isequal(punctuation(x),y_correct))\r\n\r\n%%\r\nx = '!?! Are you kidding !?!';\r\ny_correct = 6;\r\nassert(isequal(punctuation(x),y_correct))\r\n\r\n%%\r\nx = 'Nope....';\r\ny_correct = 4;\r\nassert(isequal(punctuation(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":1022,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":274,"test_suite_updated_at":"2012-02-25T16:29:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-25T16:29:32.000Z","updated_at":"2026-03-16T10:59:28.000Z","published_at":"2012-02-25T16:29:32.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\u003eCovering some basic topics I haven't seen elsewhere on Cody.\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\u003eReturn the number of punctuation characters in the input variable.\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":43084,"title":"Combine the digits to output numbers","description":"input could be of any length\r\ne.g.\r\n1.\r\nin1 = 1\r\nin2 = 2\r\noutput = 12\r\n2.\r\nin1 = 2\r\nin2 = 1\r\nin3 = 0\r\noutput = 210","description_html":"\u003cp\u003einput could be of any length\r\ne.g.\r\n1.\r\nin1 = 1\r\nin2 = 2\r\noutput = 12\r\n2.\r\nin1 = 2\r\nin2 = 1\r\nin3 = 0\r\noutput = 210\u003c/p\u003e","function_template":"function y = combineUs(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\nb = 2;\r\ny_correct = 12;\r\nassert(isequal(combineUs(x,b),y_correct))\r\n%%\r\nx = 2;\r\nb = 1;\r\nc = 0;\r\ny_correct = 210;\r\nassert(isequal(combineUs(x,b,c),y_correct))\r\n%%\r\nx = 1;\r\nb = 3;\r\nc = 0;\r\nd = 9\r\ny_correct = 1309;\r\nassert(isequal(combineUs(x,b,c,d),y_correct))\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":0,"created_by":13865,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2016-10-29T17:10:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-06T01:14:27.000Z","updated_at":"2026-03-11T15:43:45.000Z","published_at":"2016-10-06T01:17:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput could be of any length e.g. 1. in1 = 1 in2 = 2 output = 12 2. in1 = 2 in2 = 1 in3 = 0 output = 210\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":288,"title":"Construct a string from letters and counts","description":"Given two input arrays like this:\r\n    [5,3,1]\r\n    ['a','b','c']\r\n\r\nOutput a string that contains each letter the specified number of times, e.g.:\r\n\r\n    'aaaaabbbc'\r\n\r\nIf given an invalid input (for example, a negative number), output the string 'ERROR'.","description_html":"\u003cp\u003eGiven two input arrays like this:\r\n    [5,3,1]\r\n    ['a','b','c']\u003c/p\u003e\u003cp\u003eOutput a string that contains each letter the specified number of times, e.g.:\u003c/p\u003e\u003cpre\u003e    'aaaaabbbc'\u003c/pre\u003e\u003cp\u003eIf given an invalid input (for example, a negative number), output the string 'ERROR'.\u003c/p\u003e","function_template":"function y = construct_string(lengths, letters)\r\n  y = 'ERROR';\r\nend\r\n","test_suite":"%%\r\nx = []; y = [];\r\ny_correct = 'ERROR';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n%%\r\nx = [-1]; y = ['a'];\r\ny_correct = 'ERROR';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n%%\r\nx = ['a']; y = [5];\r\ny_correct = 'ERROR';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n%%\r\nr = 10+randi(20); x = [r 1]; y = 'ab';\r\ny_correct(1:r) = 'a'; y_correct(r+1) = 'b';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n%%\r\nx = [5 4 3 2 1];\r\ny = '.#4a5';\r\ny_correct = '.....####444aa5';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n\r\n%%\r\nx1 = [1 1 1 1 1 1];\r\ny = 'banana';\r\nassert(isequal(construct_string(x1,y),y))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":78,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":147,"test_suite_updated_at":"2012-02-08T19:06:38.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-08T17:07:24.000Z","updated_at":"2026-03-16T11:02:54.000Z","published_at":"2012-02-08T19:12:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two input arrays like this: [5,3,1] ['a','b','c']\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOutput a string that contains each letter the specified number of times, e.g.:\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[    'aaaaabbbc']]\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\u003eIf given an invalid input (for example, a negative number), output the string 'ERROR'.\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":44852,"title":"Mean number of letters per word (Easy)","description":"Given a character array, s, representing a sentence, return a, the arithmetic mean of the number of letters per word in the given sentence. Round your answer to three decimal digits.\r\n\r\nYou may make the following assumptions:\r\n\r\n1. All characters in the array are either letters or spaces.\r\n\r\n2. There are no redundant spaces.\r\n\r\n3. Except for spaces, there is no punctuation in the sentence.\r\n\r\n4. There will always be at least two words in the sentence.\r\n\r\nExample:\r\n\r\n  c = 'The quick brown fox jumps over the lazy dog';\r\n  \r\n  a = 3.889;\r\n\r\nExample:\r\n\r\n  c = 'Another one bites the dust';\r\n  \r\n  a = 4.400;\r\n\r\nThe next problem in this series is \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44853-mean-number-of-letters-per-word-hard Problem 44853\u003e.","description_html":"\u003cp\u003eGiven a character array, s, representing a sentence, return a, the arithmetic mean of the number of letters per word in the given sentence. Round your answer to three decimal digits.\u003c/p\u003e\u003cp\u003eYou may make the following assumptions:\u003c/p\u003e\u003cp\u003e1. All characters in the array are either letters or spaces.\u003c/p\u003e\u003cp\u003e2. There are no redundant spaces.\u003c/p\u003e\u003cp\u003e3. Except for spaces, there is no punctuation in the sentence.\u003c/p\u003e\u003cp\u003e4. There will always be at least two words in the sentence.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ec = 'The quick brown fox jumps over the lazy dog';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ea = 3.889;\r\n\u003c/pre\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ec = 'Another one bites the dust';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ea = 4.400;\r\n\u003c/pre\u003e\u003cp\u003eThe next problem in this series is \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44853-mean-number-of-letters-per-word-hard\"\u003eProblem 44853\u003c/a\u003e.\u003c/p\u003e","function_template":"function a = your_fcn_name(c)\r\n    a = 0;\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext,'eval')))\r\nassert(isempty(strfind(filetext,'echo')))\r\nassert(isempty(strfind(filetext,'switch')))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('Hello world'),5.000))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('The quick brown fox jumps over the lazy dog'),3.889))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('Another one bites the dust'),4.400))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('Antidisestablishmentarianism is the longest nonscientific word in the English language'),7.700))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('I ate pudding'),3.667))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('I hate pudding'),4.000))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":15521,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":36,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":65,"created_at":"2019-02-16T20:34:25.000Z","updated_at":"2026-03-24T12:02:15.000Z","published_at":"2019-02-16T21:25: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\",\"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 character array, s, representing a sentence, return a, the arithmetic mean of the number of letters per word in the given sentence. Round your answer to three decimal digits.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou may make the following assumptions:\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. All characters in the array are either letters or spaces.\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. There are no redundant spaces.\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\u003e3. Except for spaces, there is no punctuation in the sentence.\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\u003e4. There will always be at least two words in the sentence.\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[c = 'The quick brown fox jumps over the lazy dog';\\n\\na = 3.889;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\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[c = 'Another one bites the dust';\\n\\na = 4.400;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe next problem in this series is\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44853-mean-number-of-letters-per-word-hard\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44853\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44512,"title":"Find if a given sentence is a palindrome","description":"Given a string/character array, return true if the string is a palindrome else returns false.\r\n\r\nFor example:\r\n\r\n  sample_text = \"Sore was I ere I saw Eros.\";\r\n  isPalindrome(sample_text);\r\n  ans =\r\n        True \r\n","description_html":"\u003cp\u003eGiven a string/character array, return true if the string is a palindrome else returns false.\u003c/p\u003e\u003cp\u003eFor example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003esample_text = \"Sore was I ere I saw Eros.\";\r\nisPalindrome(sample_text);\r\nans =\r\n      True \r\n\u003c/pre\u003e","function_template":"function y = isPalindrome(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = \"Nella's simple hymn: \"\"I attain my help, Miss Allen.\";\r\ny_correct = true;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx = \"Deliver desserts,\"\" demanded Nemesis, \"\"emended, named, stressed, reviled.\";\r\ny_correct = true;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx = \"Dennis danced\";\r\ny_correct = false;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx = \"Fred ate bread\";\r\ny_correct = false;\r\nassert(isequal(isPalindrome(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":132561,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":"2018-02-07T10:05:57.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-02-05T11:44:20.000Z","updated_at":"2026-03-24T12:04:28.000Z","published_at":"2018-02-05T11:44:28.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a string/character array, return true if the string is a palindrome else returns 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\u003eFor example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[sample_text = \\\"Sore was I ere I saw Eros.\\\";\\nisPalindrome(sample_text);\\nans =\\n      True]]\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":1638,"title":"JOIN STRINGS","description":"There are two given strings 'STRING1' and 'STR ING2'.|monospaced|The output should be 'STRING1 STR ING2' or STr1='Sum';STr2='EQUALS';STr3='MATLAB', then output should be 'Sum EQUALS MATLAB'.","description_html":"\u003cp\u003eThere are two given strings 'STRING1' and 'STR ING2'.|monospaced|The output should be 'STRING1 STR ING2' or STr1='Sum';STr2='EQUALS';STr3='MATLAB', then output should be 'Sum EQUALS MATLAB'.\u003c/p\u003e","function_template":"function y = your_fcn_name(varargin)\r\n  y = x;\r\nend","test_suite":"%%\r\nstr='MATLABian';\r\nstr1='My name';\r\nstr3='kjhsdfs';\r\ny_correct ='MATLABian My name kjhsdfs';\r\nassert(strcmp(your_fcn_name(str,str1,str3),y_correct)==1)\r\n\r\n%%\r\nstr='This';\r\nstr1='is';\r\nstr3='MATLAB';\r\ny_correct ='This is MATLAB';\r\nassert(strcmp(your_fcn_name(str,str1,str3),y_correct)==1)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":13514,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":75,"test_suite_updated_at":"2013-06-10T08:44:11.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-06-10T08:29:23.000Z","updated_at":"2025-10-02T10:44:35.000Z","published_at":"2013-06-10T08:29:23.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere are two given strings 'STRING1' and 'STR ING2'.|monospaced|The output should be 'STRING1 STR ING2' or STr1='Sum';STr2='EQUALS';STr3='MATLAB', then output should be 'Sum EQUALS 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":408,"title":"Back to basics 18 - justification","description":"Covering some basic topics I haven't seen elsewhere on Cody.\r\n\r\nGiven a string with extra spaces in front and/or in back, return a 'centered' version of the string (e.g.: '    MATLAB' -\u003e '  MATLAB  ')","description_html":"\u003cp\u003eCovering some basic topics I haven't seen elsewhere on Cody.\u003c/p\u003e\u003cp\u003eGiven a string with extra spaces in front and/or in back, return a 'centered' version of the string (e.g.: '    MATLAB' -\u003e '  MATLAB  ')\u003c/p\u003e","function_template":"function y = justify(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = '    MATLAB';\r\ny_correct = '  MATLAB  ';\r\nassert(isequal(justify(x),y_correct))\r\n\r\n%%\r\nx = 'MATLAB    ';\r\ny_correct = '  MATLAB  ';\r\nassert(isequal(justify(x),y_correct))\r\n\r\n\r\n%%\r\nx = ' MATLAB   ';\r\ny_correct = '  MATLAB  ';\r\nassert(isequal(justify(x),y_correct))\r\n\r\n%%\r\nx = ' MATLAB ';\r\ny_correct = ' MATLAB ';\r\nassert(isequal(justify(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":1022,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":207,"test_suite_updated_at":"2012-02-25T16:24:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-25T16:24:36.000Z","updated_at":"2026-04-05T02:02:04.000Z","published_at":"2012-02-25T16:24: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\",\"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\u003eCovering some basic topics I haven't seen elsewhere on Cody.\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\u003eGiven a string with extra spaces in front and/or in back, return a 'centered' version of the string (e.g.: ' MATLAB' -\u003e ' 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":44004,"title":"Get chain of consecutive characters","description":"Write a function that will output a chain of consecutive characters, given 2 letters as input. It has to work backwards too. Examples:\r\n\r\n\u003e\u003e get_char_list('a', 'f')\r\nabcdef\r\n\u003e\u003e get_char_list('p', 'q')\r\npq\r\n\u003e\u003e get_char_list('x', 't')\r\nxwvut","description_html":"\u003cp\u003eWrite a function that will output a chain of consecutive characters, given 2 letters as input. It has to work backwards too. Examples:\u003c/p\u003e\u003cp\u003e\u0026gt;\u0026gt; get_char_list('a', 'f')\r\nabcdef\r\n\u0026gt;\u0026gt; get_char_list('p', 'q')\r\npq\r\n\u0026gt;\u0026gt; get_char_list('x', 't')\r\nxwvut\u003c/p\u003e","function_template":"function y = get_char_list(first,last)\r\n  y = first;\r\nend","test_suite":"%%\r\nfirst='a';\r\nlast='f';\r\nassert(isequal(get_char_list(first,last),'abcdef'))\r\n%%\r\nfirst='x';\r\nlast='t';\r\nassert(isequal(get_char_list(first,last),'xwvut'))\r\n%%\r\nfirst='p';\r\nlast='p';\r\nassert(isequal(get_char_list(first,last),'p'))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":109067,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-01-14T18:47:52.000Z","updated_at":"2026-03-16T11:08:25.000Z","published_at":"2017-01-14T18:47:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eWrite a function that will output a chain of consecutive characters, given 2 letters as input. It has to work backwards too. Examples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u0026gt; get_char_list('a', 'f') abcdef \u0026gt;\u0026gt; get_char_list('p', 'q') pq \u0026gt;\u0026gt; get_char_list('x', 't') xwvut\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":1249,"title":"first step for Huffman Coding (easy)","description":"Given a string, you must sort the characters by occurrence (from lowest to highest).\r\n\r\nThis step is necessary to generate a Huffman tree. ( \u003chttp://en.wikipedia.org/wiki/Huffman_coding\u003e )\r\n\r\nAll characters must be taken into account. Capitals are not taken into account.\r\n\r\nIf two characters appear the same number of times, the order does not matter.\r\n\r\n\r\nYou will return two arrays:\r\n\r\nthe first comprising the characters sorted.\r\nthe second comprising the number of occurrence of characters of the first array.\r\n\r\n\r\n\r\nExample : \r\n\r\ninput : \r\n\r\n    input = 'aAabbC';\r\n\r\noutput : \r\n\r\n_characters :_ \r\n\r\n  cha =\r\n  \r\n  c\r\n  b\r\n  a\r\n  \r\n\r\n_occurence :_\r\n\r\n  occ =\r\n  \r\n       1\r\n       2\r\n       3\r\n","description_html":"\u003cp\u003eGiven a string, you must sort the characters by occurrence (from lowest to highest).\u003c/p\u003e\u003cp\u003eThis step is necessary to generate a Huffman tree. ( \u003ca href=\"http://en.wikipedia.org/wiki/Huffman_coding\"\u003ehttp://en.wikipedia.org/wiki/Huffman_coding\u003c/a\u003e )\u003c/p\u003e\u003cp\u003eAll characters must be taken into account. Capitals are not taken into account.\u003c/p\u003e\u003cp\u003eIf two characters appear the same number of times, the order does not matter.\u003c/p\u003e\u003cp\u003eYou will return two arrays:\u003c/p\u003e\u003cp\u003ethe first comprising the characters sorted.\r\nthe second comprising the number of occurrence of characters of the first array.\u003c/p\u003e\u003cp\u003eExample :\u003c/p\u003e\u003cp\u003einput :\u003c/p\u003e\u003cpre\u003e    input = 'aAabbC';\u003c/pre\u003e\u003cp\u003eoutput :\u003c/p\u003e\u003cp\u003e\u003ci\u003echaracters :\u003c/i\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003echa =\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ec\r\nb\r\na\r\n\u003c/pre\u003e\u003cp\u003e\u003ci\u003eoccurence :\u003c/i\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eocc =\r\n\u003c/pre\u003e\u003cpre\u003e       1\r\n       2\r\n       3\u003c/pre\u003e","function_template":"function [cha occ] = sortHuffman(input)\r\n\r\n  cha=input;\r\n  occ = 0;\r\n\r\nend","test_suite":"%%\r\ninput = 'CoDy';\r\n[cha occ] = sortHuffman(input);\r\ncha_control = ['c';'d';'o';'y'];\r\n\r\nassert(isequal(size(cha),size(cha_control)));\r\nassert(isequal(sum(lower(input)),sum(occ.*(cha+0))));\r\nassert(all(sort(occ)==occ));\r\n\r\n\r\n%%\r\ninput = 'abcd abc ab a';\r\n[cha occ] = sortHuffman(input);\r\ncha_control = ['d';'c';' ';'b';'a'];\r\n\r\nassert(isequal(size(cha),size(cha_control)));\r\nassert(isequal(sum(lower(input)),sum(occ.*(cha+0))));\r\nassert(all(sort(occ)==occ));\r\n\r\n\r\n%%\r\ninput = 'La regression PLS (Partial Least Squares regression) est une technique d analyse et de prediction relativement recente. Elle a ete concue pour faire face aux problemes resultants de l insuffisance de l utilisation de la regression lineaire classique, qui trouve ses limites des lors que l on cherche a modeliser des relations entre des variables pour lesquelles il y a peu d individus, ou beaucoup de variables explicatives en comparaison au nombre d individus (le nombre de variables explicatives pouvant exceder tres largement le nombre d individus), ou encore lorsque les variables explicatives sont fortement correlees entre elles.';\r\n\r\n[cha occ] = sortHuffman(input);\r\n\r\ncha_control =['(';')';'.';'y';',';'h';'g';'f';'x';'q';'b';'m';'p';'v';'c';'d';'u';'o';'t';'n';'a';'l';'r';'i';'s';'e';' '];\r\n\r\nassert(isequal(size(cha),size(cha_control)));\r\nassert(isequal(sum(lower(input)),sum(occ.*(cha+0))));\r\nassert(all(sort(occ)==occ));","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":8073,"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":"2013-02-05T14:26:46.000Z","updated_at":"2026-03-16T13:53:37.000Z","published_at":"2013-02-05T14:26:46.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a string, you must sort the characters by occurrence (from lowest to highest).\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\u003eThis step is necessary to generate a Huffman tree. (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Huffman_coding\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Huffman_coding\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e )\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAll characters must be taken into account. Capitals are not taken into account.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf two characters appear the same number of times, the order does not matter.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou will return two arrays:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethe first comprising the characters sorted. the second comprising the number of occurrence of characters of the first array.\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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput :\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 = 'aAabbC';]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput :\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003echaracters :\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[cha =\\n\\nc\\nb\\na]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eoccurence :\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[occ =\\n\\n       1\\n       2\\n       3]]\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":44661,"title":"Remove white spaces at the end of the input string","description":"Remove all trailing white spaces at the end of the input strings","description_html":"\u003cp\u003eRemove all trailing white spaces at the end of the input strings\u003c/p\u003e","function_template":"function y = rem_trail_ws(A)\r\n  A\r\nend","test_suite":"%%\r\nA = 'This is a test string.             ';\r\ny_correct = 'This is a test string.';\r\nassert(isequal(rem_trail_ws(A),y_correct))\r\n\r\n%%\r\nA = '          Testing function rem_trail_ws';\r\ny_correct = '          Testing function rem_trail_ws';\r\nassert(isequal(rem_trail_ws(A),y_correct))\r\n\r\n%%\r\nA = {'MATLAB    ','SIMULINK    ';\r\n     'Toolboxes    ','MathWorks    '};\r\ny_correct = {'MATLAB','SIMULINK';\r\n     'Toolboxes','MathWorks'};\r\nassert(isequal(rem_trail_ws(A),y_correct))\r\n\r\n%%\r\nA = sprintf('MATHWORKS \\t');\r\ny_correct = 'MATHWORKS';\r\nassert(isequal(rem_trail_ws(A),y_correct))","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":54,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T14:21:22.000Z","updated_at":"2025-12-07T18:25:49.000Z","published_at":"2018-05-29T14:21:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRemove all trailing white spaces at the end of the input strings\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":51755,"title":"Make the first letter of a sentence Capital.","description":"In this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You will not be given a string with any names. You have to keep all the spaces, symbols as they are given, except the first letter of the sentence.\r\nHappy coding!!!","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: 93px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 46.5px; transform-origin: 407px 46.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 379.5px 8px; transform-origin: 379.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You will not be given a string with any names. You have to keep all the spaces, symbols as they are given, except the first letter of the sentence.\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: 50.5px 8px; transform-origin: 50.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHappy coding!!!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = making_capital(x)\r\n\r\nend","test_suite":"%%\r\nx = 'hello everyone. how are you? its a nice day for walk';\r\ny_correct = 'Hello everyone. How are you? Its a nice day for walk';\r\nassert(isequal(making_capital(x),y_correct))\r\n\r\n%%\r\nx = 'long long day ago there was a king. he was very kind to his people. people loved him very much';\r\ny_correct = 'Long long day ago there was a king. He was very kind to his people. People loved him very much';\r\nassert(isequal(making_capital(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1022097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":25,"test_suite_updated_at":"2021-07-16T06:51:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-05-12T16:33:03.000Z","updated_at":"2026-03-09T03:03:53.000Z","published_at":"2021-05-17T06:20:52.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\u003eIn this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You will not be given a string with any names. You have to keep all the spaces, symbols as they are given, except the first letter of the sentence.\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\u003eHappy coding!!!\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":61028,"title":"The Case of the Missing Prototype – Extract the Culprit’s Name from a Mixed Letter-and-Number Email Message","description":"While tracing the suspect’s digital footprint, you recover an email containing a mixed string of letters and numbers.The letters spell out the sender’s name, while the numbers are irrelevant noise.\r\nGiven a string msg, extract only the letters and return them in order to reveal the culprit’s name.\r\nThis small clue may finally tell you who sent the message!","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; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 102px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 51px; transform-origin: 408px 51px; 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: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWhile tracing the suspect’s digital footprint, you recover an email containing a \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003emixed string of letters and numbers\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.The letters spell out the sender’s name, while the numbers are irrelevant noise.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a string \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003emsg\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, extract \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eonly the letters\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and return them in order to reveal the culprit’s name.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis small clue may finally tell you \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ewho sent the message\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = extractName(msg)\r\n  y = x;\r\nend","test_suite":"%%\r\nmsg = 'r2i1t3i0k';\r\ny_correct = 'ritik';\r\nassert(isequal(extractName(msg),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":4953963,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":54,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-10-20T17:00:48.000Z","updated_at":"2026-04-03T04:00:39.000Z","published_at":"2025-10-20T17:00:48.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhile tracing the suspect’s digital footprint, you recover an email containing a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emixed string of letters and numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.The letters spell out the sender’s name, while the numbers are irrelevant noise.\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\u003eGiven a string \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emsg\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, extract \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eonly the letters\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and return them in order to reveal the culprit’s name.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis small clue may finally tell you \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewho sent the message\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\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":44669,"title":"Dial Up","description":"Each number on telephone keypads, except 0 and 1, corresponds to a set of uppercase letters as shown in this list:\r\n2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ\r\nHence, a phone-number specification can include uppercase letters and digits. Write a function called dial that takes as its input argument a char vector of length 16 or less that includes only these characters and returns as its output argument the telephone number as a uint64. \r\n\r\n*Here is the input and output for one example of a call of the function:\r\n\r\nInput: '1FUNDOG4YOU'\r\nOutput: 13863644968*\r\nYou can assume that a phone number never starts with 0. If the input contains any illegal characters, the function returns 0.","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: 225px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 112.5px; transform-origin: 407px 112.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; 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: 371px 8px; transform-origin: 371px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEach number on telephone keypads, except 0 and 1, corresponds to a set of uppercase letters as shown in this list: 2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ Hence, a phone-number specification can include uppercase letters and digits. Write a function called dial that takes as its input argument a char vector of length 16 or less that includes only these characters and returns as its output argument the telephone number as a uint64.\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: 218px 8px; transform-origin: 218px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e*Here is the input and output for one example of a call of the function:\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=\"\"\u003eInput: '1FUNDOG4YOU' \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: 74px 8px; transform-origin: 74px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOutput: 13863644968* \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: 381.5px 8px; transform-origin: 381.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou can assume that a phone number never starts with 0. If the input contains any illegal characters, the function returns 0.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"%function to convert a string into corresponding phone number\r\nfunction out = dial(inp)\r\n\r\nend","test_suite":"%%\r\ninp = '1WEAR2A3MASK4';\r\nout_correct = 1932722362754;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = '1FUNDOG4YOU';\r\nout_correct = 13863644968;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = '1 (FUN) DOG-4-YOU #2';\r\nout_correct = 0;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = '6C89YEAH47SUP2JK';\r\nout_correct = 6289932447787255;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = '8YO1HEY9USA';\r\nout_correct = 89614399872;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = 'ST4Y H0ME,ST4Y S4FE';\r\nout_correct = 0;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = 'CH59PIV4BMW32';\r\nout_correct = 2459748426932;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = 'GOLD (1$) SHINNY';\r\nout_correct = 0;\r\nassert(isequal(dial(inp),out_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":"2021-05-04T14:18:01.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2018-05-30T10:39:23.000Z","updated_at":"2025-12-07T21:22:17.000Z","published_at":"2018-05-30T10:39:23.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\u003eEach number on telephone keypads, except 0 and 1, corresponds to a set of uppercase letters as shown in this list: 2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ Hence, a phone-number specification can include uppercase letters and digits. Write a function called dial that takes as its input argument a char vector of length 16 or less that includes only these characters and returns as its output argument the telephone number as a uint64.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e*Here is the input and output for one example of a call of the function:\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\u003eInput: '1FUNDOG4YOU' \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\u003eOutput: 13863644968* \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou can assume that a phone number never starts with 0. If the input contains any illegal characters, the function returns 0.\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":552,"title":"Cell Array Inception?","description":"Jimmy is a beginning MATLAB student who is trying to read in a text file and build a cell array of strings, where A{k} is the kth line of the text file.  He writes the following code, and is confused when it doesn't work:\r\n\r\n  fid = fopen('myfile.txt','r');\r\n  A = {};\r\n  while ~feof(fid)\r\n      A = {A fgetl(fid)};\r\n  end\r\n\r\nWhat he finds is that after the loop, A only has two components, no matter what the file length.  The second component is the last line of the file, and the first component is another cell array!  He then realizes that A{1} also has two components, where the second component is the second-last line of the file and the first component is yet another cell array!\r\n\r\nYour task: write a function to undo this \"cell-array Inception\" and return the proper cell array of strings that Jimmy is looking for.  Implement B = unInception(A), where A is the cell array as returned by Jimmy's code.\r\n","description_html":"\u003cp\u003eJimmy is a beginning MATLAB student who is trying to read in a text file and build a cell array of strings, where A{k} is the kth line of the text file.  He writes the following code, and is confused when it doesn't work:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003efid = fopen('myfile.txt','r');\r\nA = {};\r\nwhile ~feof(fid)\r\n    A = {A fgetl(fid)};\r\nend\r\n\u003c/pre\u003e\u003cp\u003eWhat he finds is that after the loop, A only has two components, no matter what the file length.  The second component is the last line of the file, and the first component is another cell array!  He then realizes that A{1} also has two components, where the second component is the second-last line of the file and the first component is yet another cell array!\u003c/p\u003e\u003cp\u003eYour task: write a function to undo this \"cell-array Inception\" and return the proper cell array of strings that Jimmy is looking for.  Implement B = unInception(A), where A is the cell array as returned by Jimmy's code.\u003c/p\u003e","function_template":"function B = unInception(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nx = {{{{{{{{} 'hello'} 'world'} 'this'} 'is'} 'a'} 'string'} 'array'};\r\ny_correct = {'hello' 'world' 'this' 'is' 'a' 'string' 'array'};\r\nassert(isequal(unInception(x),y_correct))\r\n%%\r\nx = {};\r\ny_correct = {};\r\nassert(isequal(unInception(x),y_correct))\r\n%%\r\nx = {{} ''};\r\ny_correct = {''};\r\nassert(isequal(unInception(x),y_correct))\r\n%%\r\nx = {{{{} 'hello'} ''} 'yeah'};\r\ny_correct = {'hello' '' 'yeah'};\r\nassert(isequal(unInception(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":1537,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":30,"test_suite_updated_at":"2012-04-03T04:47:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-04-03T04:47:52.000Z","updated_at":"2025-12-29T14:38:50.000Z","published_at":"2012-04-03T04:47:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eJimmy is a beginning MATLAB student who is trying to read in a text file and build a cell array of strings, where A{k} is the kth line of the text file. He writes the following code, and is confused when it doesn't work:\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[fid = fopen('myfile.txt','r');\\nA = {};\\nwhile ~feof(fid)\\n    A = {A fgetl(fid)};\\nend]]\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\u003eWhat he finds is that after the loop, A only has two components, no matter what the file length. The second component is the last line of the file, and the first component is another cell array! He then realizes that A{1} also has two components, where the second component is the second-last line of the file and the first component is yet another cell array!\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\u003eYour task: write a function to undo this \\\"cell-array Inception\\\" and return the proper cell array of strings that Jimmy is looking for. Implement B = unInception(A), where A is the cell array as returned by Jimmy's code.\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":42677,"title":"Print the date for a given number using Indian calendar reference","description":"Print date for a given number in date reference is INDIAN calendar, not Christ's Birth\r\n\r\nThe Vikram Samvat is said to have been founded by the emperor Vikramaditya of Malwa following his victory over the Sakas in 56 Years, 8 Months, 17 Days BCE. Output Format is dd/mm/yyyy.","description_html":"\u003cp\u003ePrint date for a given number in date reference is INDIAN calendar, not Christ's Birth\u003c/p\u003e\u003cp\u003eThe Vikram Samvat is said to have been founded by the emperor Vikramaditya of Malwa following his victory over the Sakas in 56 Years, 8 Months, 17 Days BCE. Output Format is dd/mm/yyyy.\u003c/p\u003e","function_template":"function y = date_in(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = '31/08/0056';\r\nassert(isequal(date_in(x),y_correct))\r\n%% \r\nx = 736268;\r\ny_correct = '30/06/2072';\r\nassert(isequal(date_in(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":28123,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-10-31T15:58:30.000Z","updated_at":"2026-03-16T10:33:03.000Z","published_at":"2015-10-31T15:58:41.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\u003ePrint date for a given number in date reference is INDIAN calendar, not Christ's Birth\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 Vikram Samvat is said to have been founded by the emperor Vikramaditya of Malwa following his victory over the Sakas in 56 Years, 8 Months, 17 Days BCE. Output Format is dd/mm/yyyy.\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":54495,"title":"Remove Upper Case Letters","description":"Example\r\nMatlab --\u003e atlab\r\nproBlem --\u003e prolem\r\nEnter --\u003e nter","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: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: 700; \"\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eMatlab --\u0026gt; atlab\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eproBlem --\u0026gt; prolem\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eEnter --\u0026gt; nter\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  y = x;\r\nend","test_suite":"%%\r\nx = 'Matlab';\r\ny_correct = 'atlab';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'Cody';\r\ny_correct = 'ody';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'meMbers';\r\ny_correct = 'mebers';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'ReSEmBlAncE';\r\ny_correct = 'emlnc';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":232412,"edited_by":232412,"edited_at":"2022-05-04T12:32:45.000Z","deleted_by":null,"deleted_at":null,"solvers_count":278,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-05-04T12:31:50.000Z","updated_at":"2026-03-20T14:09:36.000Z","published_at":"2022-05-04T12:32:45.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMatlab --\u0026gt; atlab\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\u003eproBlem --\u0026gt; prolem\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\u003eEnter --\u0026gt; nter\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":1560,"title":"COUNT VOWEL 2","description":"The objective of this problem is to determine the number of unique vowels used in the given string.\r\n\r\n Now count vowels in STRING.\r\n\r\nEXAMPLE:\r\n\r\n STRING='We are the MaTLaBins'; then OUTPUT is 3\r\n\r\nor,\r\n\r\n STRING='LaBoRaToRy'; then OUTPUT will be 2","description_html":"\u003cp\u003eThe objective of this problem is to determine the number of unique vowels used in the given string.\u003c/p\u003e\u003cpre\u003e Now count vowels in STRING.\u003c/pre\u003e\u003cp\u003eEXAMPLE:\u003c/p\u003e\u003cpre\u003e STRING='We are the MaTLaBins'; then OUTPUT is 3\u003c/pre\u003e\u003cp\u003eor,\u003c/p\u003e\u003cpre\u003e STRING='LaBoRaToRy'; then OUTPUT will be 2\u003c/pre\u003e","function_template":"function y = VOWEL_COUNTER2(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx='We are the MaTLaBins';\r\ny_correct = 3;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='ThiS iS tHe MaTLaB CoDiNg';\r\ny_correct = 4;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='eDuCaTioN';\r\ny_correct = 5;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='LaBoRaToRy';\r\ny_correct = 2;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='Deleted';\r\ny_correct = 1;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='Dltd';\r\ny_correct = 0;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":13514,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":84,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-06-06T11:04:24.000Z","updated_at":"2025-11-13T17:56:30.000Z","published_at":"2013-06-06T11:04:32.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe objective of this problem is to determine the number of unique vowels used in the given string.\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[ Now count vowels in STRING.]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE:\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[ STRING='We are the MaTLaBins'; then OUTPUT is 3]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eor,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ STRING='LaBoRaToRy'; then OUTPUT will be 2]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44730,"title":"Substring Extraction","description":"In a given string, find the substring between Start_string and End_string. \r\n\r\nYou will have to include or exclude the Start_string and End_string as a part of the substring depending on the third argument 'include_se'\r\n\r\nIf include_se=1, include the Start_string and End_string as a part of the extracted substring, else exclude them\r\n\r\nExample: \r\n\r\n  input_str: 'This is a test sentence'\r\n  Start_string: 'is'\r\n  End_string: 'sentence'\r\n  include_se=1\r\n  extract_function(input_str,Start_string,End_string, include_se)= 'is a test sentence'\r\n","description_html":"\u003cp\u003eIn a given string, find the substring between Start_string and End_string.\u003c/p\u003e\u003cp\u003eYou will have to include or exclude the Start_string and End_string as a part of the substring depending on the third argument 'include_se'\u003c/p\u003e\u003cp\u003eIf include_se=1, include the Start_string and End_string as a part of the extracted substring, else exclude them\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003einput_str: 'This is a test sentence'\r\nStart_string: 'is'\r\nEnd_string: 'sentence'\r\ninclude_se=1\r\nextract_function(input_str,Start_string,End_string, include_se)= 'is a test sentence'\r\n\u003c/pre\u003e","function_template":"function output_str = extract_function(input_str,Start_string,End_string, include_se)\r\n\r\nend","test_suite":"%%\r\ninput_str= 'This is a test sentence'\r\nStart_string= ' is'\r\nEnd_string= 'sentence'\r\ninclude_se=1\r\noutput_str= {' is a test sentence'}\r\nassert(isequal(extract_function(input_str,Start_string,End_string, include_se),output_str))\r\n\r\n%%\r\ninput_str= 'This is a test sentence'\r\nStart_string= ' is'\r\nEnd_string= 'sentence'\r\ninclude_se=0\r\noutput_str={' a test '}\r\nassert(isequal(extract_function(input_str,Start_string,End_string, include_se),output_str))\r\n\r\n%%\r\ninput_str= 'Right now!I said RIGHT NOW!'\r\nStart_string= 'now!'\r\nEnd_string= '!'\r\ninclude_se=0\r\noutput_str={'I said RIGHT NOW'}\r\nassert(isequal(extract_function(input_str,Start_string,End_string, include_se),output_str))","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":31,"test_suite_updated_at":"2018-08-16T12:54:54.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-08-16T12:52:30.000Z","updated_at":"2025-12-29T13:54:03.000Z","published_at":"2018-08-16T12:52: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\u003eIn a given string, find the substring between Start_string and End_string.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou will have to include or exclude the Start_string and End_string as a part of the substring depending on the third argument 'include_se'\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf include_se=1, include the Start_string and End_string as a part of the extracted substring, else exclude them\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_str: 'This is a test sentence'\\nStart_string: 'is'\\nEnd_string: 'sentence'\\ninclude_se=1\\nextract_function(input_str,Start_string,End_string, include_se)= 'is a test sentence']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":43280,"title":"Replace x value into y value in string text.","description":"Replace x value into y value in string text. Example text='Hello World' x='World', y='Universe' result='Hello Universe'.","description_html":"\u003cp\u003eReplace x value into y value in string text. Example text='Hello World' x='World', y='Universe' result='Hello Universe'.\u003c/p\u003e","function_template":"function y = Replace(text,x,y)\r\n  text = x-y;\r\nend","test_suite":"%%\r\ntext='Hello World';\r\nx='World';\r\ny='Universe';\r\ny_correct = 'Hello Universe';\r\nassert(isequal(Replace(text,x,y),y_correct))\r\n%%\r\ntext='A woman is in the Bahamas. She visits a dolphin encounter. She drops her phone in the water. A dolphin finds the phone. It brings it back to the woman. Unfortunately, the phone is already dead. Difficult words: dolphin encounter (when you get to visit a dolphin), drop (to let something fall by accident), unfortunately (sadly).'\r\nx='dolphin';\r\ny='whale';\r\ny_correct = 'A woman is in the Bahamas. She visits a whale encounter. She drops her phone in the water. A whale finds the phone. It brings it back to the woman. Unfortunately, the phone is already dead. Difficult words: whale encounter (when you get to visit a whale), drop (to let something fall by accident), unfortunately (sadly).';\r\nassert(isequal(Replace(text,x,y),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":80,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-09T13:02:49.000Z","updated_at":"2026-02-05T08:29:07.000Z","published_at":"2016-10-09T13:02:49.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\u003eReplace x value into y value in string text. Example text='Hello World' x='World', y='Universe' result='Hello Universe'.\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":44294,"title":"Simple String Concatenation","description":"This is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.","description_html":"\u003cp\u003eThis is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.\u003c/p\u003e","function_template":"function concat_str = your_fcn_name(str1, str2)\r\n  concat_str = ...;\r\nend","test_suite":"%%\r\nstr1 = 'apple';\r\nstr2 = 'pear';\r\nconcat_str = 'apple pear';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one';\r\nstr2 = 'two';\r\nconcat_str = 'one two';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one two';\r\nstr2 = 'three four';\r\nconcat_str = 'one two three four';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'hello';\r\nstr2 = 'there';\r\nconcat_str = 'hello there';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'This is half a sentence;';\r\nstr2 = 'here is the other half.';\r\nconcat_str = 'This is half a sentence; here is the other half.';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'left';\r\nstr2 = 'right';\r\nconcat_str = 'left right';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'right';\r\nstr2 = 'left';\r\nconcat_str = 'right left';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = ' leading space';\r\nstr2 = 'trailing space ';\r\nconcat_str = ' leading space trailing space ';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = '123';\r\nstr2 = '456';\r\nconcat_str = '123 456';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":86,"test_suite_updated_at":"2017-09-08T19:18:15.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:32:01.000Z","updated_at":"2026-03-02T17:19:15.000Z","published_at":"2017-09-06T00:32:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eThis is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.\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":44295,"title":"More Simple String Concatenation","description":"Take the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.","description_html":"\u003cp\u003eTake the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.\u003c/p\u003e","function_template":"function concat_str = your_fcn_name(str1, str2)\r\n  concat_str = ...;\r\nend","test_suite":"%%\r\nstr1 = 'apple';\r\nstr2 = 'pear';\r\nconcat_str = 'elppa pear';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one';\r\nstr2 = 'two';\r\nconcat_str = 'eno two';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one two';\r\nstr2 = 'three four';\r\nconcat_str = 'owt eno three four';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'hello';\r\nstr2 = 'there';\r\nconcat_str = 'olleh there';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'This is half a sentence;';\r\nstr2 = 'here is the other half.';\r\nconcat_str = ';ecnetnes a flah si sihT here is the other half.';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'left';\r\nstr2 = 'right';\r\nconcat_str = 'tfel right';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'right';\r\nstr2 = 'left';\r\nconcat_str = 'thgir left';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = ' leading space';\r\nstr2 = 'trailing space ';\r\nconcat_str = 'ecaps gnidael  trailing space ';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = '123';\r\nstr2 = '456';\r\nconcat_str = '321 456';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":76,"test_suite_updated_at":"2017-09-08T19:22:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:35:50.000Z","updated_at":"2026-03-02T17:20:07.000Z","published_at":"2017-09-06T00:35:50.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 the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.\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":43232,"title":"Count me in","description":"Count the number of occurrences of the second input in the first input\r\n\r\nEx. \r\n\r\n    x1 = 12344455511; x2 =2; output = 1\r\n\r\n    x1 = 12344455511; x2 =1; output = 3","description_html":"\u003cp\u003eCount the number of occurrences of the second input in the first input\u003c/p\u003e\u003cp\u003eEx.\u003c/p\u003e\u003cpre\u003e    x1 = 12344455511; x2 =2; output = 1\u003c/pre\u003e\u003cpre\u003e    x1 = 12344455511; x2 =1; output = 3\u003c/pre\u003e","function_template":"function y = countMeIn(a,b)\r\n  y = b;\r\nend","test_suite":"%%\r\na = 1234455611;\r\nb = 2;\r\ny_correct = 1;\r\nassert(isequal(countMeIn(a,b),y_correct))\r\n%%\r\na = 1234455611;\r\nb = 1\r\ny_correct = 3;\r\nassert(isequal(countMeIn(a,b),y_correct))\r\n%%\r\na = 1234455611;\r\nb = 4\r\ny_correct = 2;\r\nassert(isequal(countMeIn(a,b),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":0,"created_by":13865,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":92,"test_suite_updated_at":"2016-10-29T16:32:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-08T15:55:13.000Z","updated_at":"2026-02-20T13:29:39.000Z","published_at":"2016-10-08T15:56:54.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCount the number of occurrences of the second input in the first input\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\u003eEx.\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[    x1 = 12344455511; x2 =2; output = 1\\n\\n    x1 = 12344455511; x2 =1; output = 3]]\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":42592,"title":"Create cell array of strings","description":"Convert the input to a cell array, but only if necessary.\r\n\r\nIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.","description_html":"\u003cp\u003eConvert the input to a cell array, but only if necessary.\u003c/p\u003e\u003cp\u003eIf the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.\u003c/p\u003e","function_template":"function C = str2cell(S)\r\n  C = '';\r\nend","test_suite":"%%\r\nS = 'Testing, testing, 1, 2, 3';\r\nassert(isequal(str2cell(S),{S}))\r\n\r\n%%\r\nS = {'I','love','MATLAB'};\r\nassert(isequal(str2cell(S),S))\r\n\r\n%%\r\nS = datestr(now);\r\nassert(isequal(str2cell(S),{S}))\r\n\r\n%%\r\nfor ii=1:100\r\n  S = char(randi([97,122],1,100));\r\n  assert(isequal(str2cell(S),{S}))\r\nend\r\n\r\n%%\r\nfor ii=1:100\r\n  S = num2cell(char(randi([97,122],100,1)));\r\n  assert(isequal(str2cell(S),S))\r\nend","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-09-09T21:15:00.000Z","updated_at":"2026-02-17T08:36:16.000Z","published_at":"2015-09-09T21:15: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\",\"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\u003eConvert the input to a cell array, but only if necessary.\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 the input is a string, return a 1-by-1 cell array containing the string. If the input is a cell array of strings, return the input unaltered.\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":44297,"title":"Automatic String Editing","description":"In this function, you will take an incoming string, and output the same string with each character one letter later in the alphabet (i.e. 'abcd' becomes 'bcde', etc). \r\n\r\nThis function will only take undercase letters from a-y","description_html":"\u003cp\u003eIn this function, you will take an incoming string, and output the same string with each character one letter later in the alphabet (i.e. 'abcd' becomes 'bcde', etc).\u003c/p\u003e\u003cp\u003eThis function will only take undercase letters from a-y\u003c/p\u003e","function_template":"function str2 = your_fcn_name(str1)\r\n  str2 = ...;\r\nend","test_suite":"%%\r\nstr1 = 'abcd';\r\nstr2 = 'bcde';\r\nassert(isequal(your_fcn_name(str1),str2))\r\n\r\n%%\r\nstr1 = 'aeiou';\r\nstr2 = 'bfjpv';\r\nassert(isequal(your_fcn_name(str1),str2))\r\n\r\n%%\r\nstr1 = 'hello';\r\nstr2 = 'ifmmp';\r\nassert(isequal(your_fcn_name(str1),str2))\r\n\r\n%%\r\nstr1 = 'bncdcvnqc';\r\nstr2 = 'codedword';\r\nassert(isequal(your_fcn_name(str1),str2))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":72,"test_suite_updated_at":"2017-09-08T19:26:37.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T01:03:16.000Z","updated_at":"2026-02-17T14:05:38.000Z","published_at":"2017-09-06T01:03:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn this function, you will take an incoming string, and output the same string with each character one letter later in the alphabet (i.e. 'abcd' becomes 'bcde', etc).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis function will only take undercase letters from a-y\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":44620,"title":"generate capital english alphabets ","description":"Based on the numeric input 'n', generate the capital english alphabet starting from A till the english alphabet at the 'n'th position.\r\n\r\nEx: if n=3, generate 'ABC'","description_html":"\u003cp\u003eBased on the numeric input 'n', generate the capital english alphabet starting from A till the english alphabet at the 'n'th position.\u003c/p\u003e\u003cp\u003eEx: if n=3, generate 'ABC'\u003c/p\u003e","function_template":"function letters = generate_alphabets(n)\r\n letters = [];\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 'A';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 6;\r\ny_correct = 'ABCDEF';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 26;\r\ny_correct = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 12;\r\ny_correct = 'ABCDEFGHIJKL';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 21;\r\ny_correct = 'ABCDEFGHIJKLMNOPQRSTU';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n\r\n%%\r\nn = 3;\r\ny_correct = 'ABC';\r\nassert(isequal(generate_alphabets(n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2018-07-16T17:02:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-20T08:51:49.000Z","updated_at":"2026-03-02T08:58:15.000Z","published_at":"2018-04-20T08:51:49.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\u003eBased on the numeric input 'n', generate the capital english alphabet starting from A till the english alphabet at the 'n'th position.\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\u003eEx: if n=3, generate 'ABC'\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":44548,"title":"ASCII sum of phrases","description":"Find the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array:\r\n[77   121    32   110    97   109   101    32   105   115    32   116   101   115   116] i.e. 1379","description_html":"\u003cp\u003eFind the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array:\r\n[77   121    32   110    97   109   101    32   105   115    32   116   101   115   116] i.e. 1379\u003c/p\u003e","function_template":"function y = str_to_number(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'Tilda : ~';\r\ny_correct = 742;\r\nassert(isequal(str_to_number(x),742))\r\n%%\r\nx = 'Practise more';\r\ny_correct = 1294;\r\nassert(isequal(str_to_number(x),1294))\r\n%%\r\nx = '1 last test';\r\ny_correct = 997;\r\nassert(isequal(str_to_number(x),997))\r\n%%\r\nx = 'OK, Definitely the last!';\r\ny_correct = 997;\r\nassert(isequal(str_to_number(x),2121))","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":50,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-02T16:01:56.000Z","updated_at":"2026-03-02T09:04:48.000Z","published_at":"2018-04-02T16:01: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 the sum of the numeric equivalents of all characters entered in a phrase. For example: for the phrase 'My name is test', the result should be a sum of the array: [77 121 32 110 97 109 101 32 105 115 32 116 101 115 116] i.e. 1379\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":44662,"title":"Check if there are white spaces in the input string","description":"If there are white spaces in the input string, output=1 else 0","description_html":"\u003cp\u003eIf there are white spaces in the input string, output=1 else 0\u003c/p\u003e","function_template":"function y = white_space_tf(x)\r\n  \r\nend","test_suite":"%%\r\nx = '123 test';\r\ny_correct = 1;\r\nassert(isequal(white_space_tf(x),y_correct))\r\n\r\n%%\r\nx = '123';\r\ny_correct = 0;\r\nassert(isequal(white_space_tf(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T14:24:57.000Z","updated_at":"2026-03-05T10:45:19.000Z","published_at":"2018-05-29T14:24:57.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\u003eIf there are white spaces in the input string, output=1 else 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":60699,"title":"Palindrome Checker","description":"Check to see if a given string is a palindrome (a word, phrase, or sequence that reads the same backward as forward).\r\nOutput should be true or false!\r\n*Bonus points (*imaginary) for code that checks each element in a given string array","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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: 366.8px 8px; transform-origin: 366.8px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCheck to see if a given string is a palindrome (a word, phrase, or sequence that reads the same backward as forward).\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-collapse: preserve; 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: 94.125px 8px; transform-origin: 94.125px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOutput should be true or false!\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-collapse: preserve; 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: 43.1833px 8px; transform-origin: 43.1833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e*Bonus points\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 41.625px 8px; transform-origin: 41.625px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e (*imaginary) \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 175.425px 8px; transform-origin: 175.425px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003efor code that checks each element in a given string array\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function s = pal_check(x)\r\n  s = false;\r\nend","test_suite":"%%\r\nx = \"hello\";\r\ns = false;\r\nassert(isequal(pal_check(x),s))\r\n%%\r\nx = \"madam\";\r\ns = true;\r\nassert(isequal(pal_check(x),s))\r\n%%\r\nx = \"level\";\r\ns = true;\r\nassert(isequal(pal_check(x),s))\r\n%%\r\nx = \"matlab\";\r\ns = false;\r\nassert(isequal(pal_check(x),s))\r\n%%\r\nx = \"saippuakivikauppias\";\r\ns = true;\r\nassert(isequal(pal_check(x),s))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":4585291,"edited_by":4585291,"edited_at":"2024-08-07T15:53:41.000Z","deleted_by":null,"deleted_at":null,"solvers_count":31,"test_suite_updated_at":"2024-08-07T15:53:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2024-08-07T15:46:41.000Z","updated_at":"2026-02-19T15:43:02.000Z","published_at":"2024-08-07T15:53:41.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCheck to see if a given string is a palindrome (a word, phrase, or sequence that reads the same backward as forward).\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\u003eOutput should be true or 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003e*Bonus points\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e (*imaginary) \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003efor code that checks each element in a given string array\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":1741,"title":"Numeric array to cell array of strings (easy)","description":"Given a numeric array (A) and a 1xk cell array of strings (C), return a cell array (B) that is the same size as A and in which each element of B is the string in C indexed by the same element in A.\r\n\r\nYou may assume that every element of A is an integer on the interval [1,k].\r\n\r\n*Example*\r\n\r\nIf\r\n\r\n  A = [1 2 3\r\n       2 3 1\r\n       3 1 2];\r\n  C = {'yes','no','maybe'};\r\n\r\nThen\r\n\r\n  B = {'yes'    'no'     'maybe'\r\n       'no'     'maybe'  'yes'\r\n       'maybe'  'yes'    'no'};","description_html":"\u003cp\u003eGiven a numeric array (A) and a 1xk cell array of strings (C), return a cell array (B) that is the same size as A and in which each element of B is the string in C indexed by the same element in A.\u003c/p\u003e\u003cp\u003eYou may assume that every element of A is an integer on the interval [1,k].\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = [1 2 3\r\n     2 3 1\r\n     3 1 2];\r\nC = {'yes','no','maybe'};\r\n\u003c/pre\u003e\u003cp\u003eThen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eB = {'yes'    'no'     'maybe'\r\n     'no'     'maybe'  'yes'\r\n     'maybe'  'yes'    'no'};\r\n\u003c/pre\u003e","function_template":"function B = ind2str(A,C)\r\n  B = A;\r\nend","test_suite":"%%\r\nA = [1 2 3\r\n     2 3 1\r\n     3 1 2];\r\nC = {'yes','no','maybe'};\r\nB_correct = {'yes'    'no'     'maybe'\r\n             'no'     'maybe'  'yes'\r\n             'maybe'  'yes'    'no'};\r\nassert(isequal(ind2str(A,C),B_correct))\r\n\r\n%%\r\nA = ones(20,1);\r\nC = {'apples','oranges'};\r\nassert(all(strcmp(ind2str(A,C),'apples')))\r\n\r\n%%\r\nA = randi(1000,[22,10]);\r\nC = arrayfun(@(x) num2str(x),1:1000,'uni',0);\r\nassert(isequal(A,cellfun(@(c) str2num(c),ind2str(A,C))))\r\n\r\n%%\r\nA = randi(2,[1,100]);\r\nC = {'0','1'};\r\nassert(isequal(A-1,cellfun(@(c) str2num(c),ind2str(A,C))))\r\n\r\n%%\r\nA = [2 4 4 2 2 4];\r\nC = {'foo','bar','baz','qux'};\r\nB_correct = {'bar' 'qux' 'qux' 'bar' 'bar' 'qux'};\r\nassert(isequal(ind2str(A,C),B_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-23T17:44:26.000Z","updated_at":"2026-02-27T13:58:55.000Z","published_at":"2013-07-23T17:44:26.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 numeric array (A) and a 1xk cell array of strings (C), return a cell array (B) that is the same size as A and in which each element of B is the string in C indexed by the same element in 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\u003eYou may assume that every element of A is an integer on the interval [1,k].\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[A = [1 2 3\\n     2 3 1\\n     3 1 2];\\nC = {'yes','no','maybe'};]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThen\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[B = {'yes'    'no'     'maybe'\\n     'no'     'maybe'  'yes'\\n     'maybe'  'yes'    'no'};]]\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":1230,"title":"Who is the smartest MATLAB programmer?","description":"Who is the smartest MATLAB programmer?\r\n\r\nExamples:\r\n\r\n  Input x = 'Is it Obama?'\r\n  Output = 'Me!'\r\n\r\n  Input x = 'Who ?'\r\n  Output = 'Me!'\r\n\r\nReturn 'Me!' to all inputs. (Note: this is only a joke!)","description_html":"\u003cp\u003eWho is the smartest MATLAB programmer?\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput x = 'Is it Obama?'\r\nOutput = 'Me!'\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eInput x = 'Who ?'\r\nOutput = 'Me!'\r\n\u003c/pre\u003e\u003cp\u003eReturn 'Me!' to all inputs. (Note: this is only a joke!)\u003c/p\u003e","function_template":"function y = smartest(x)\r\n  y = 'Not me!';\r\nend","test_suite":"%%\r\nx = 'I have been using MATLAB for 50 years!';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = 'I developed MATLAB!';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = '';\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n\r\n%%\r\nx = 1;\r\ny_correct = 'Me!';\r\nassert(isequal(smartest(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":3,"created_by":10338,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":791,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-30T01:41:14.000Z","updated_at":"2026-03-18T08:03:59.000Z","published_at":"2013-01-30T01:41:14.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\u003eWho is the smartest MATLAB programmer?\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[Input x = 'Is it Obama?'\\nOutput = 'Me!'\\n\\nInput x = 'Who ?'\\nOutput = 'Me!']]\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\u003eReturn 'Me!' to all inputs. (Note: this is only a joke!)\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":325,"title":"2 b | ~ 2 b","description":"Given a string input, output true if there are 2 b's in it, false if otherwise\r\nExamples:\r\n'Macbeth' -\u003e false 'Publius Cornelius Dolabella' -\u003e true\r\nNote: sometimes it's the littlest things that matter....","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: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 223px 8px; transform-origin: 223px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a string input, output true if there are 2 b's in it, false if otherwise\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: 32px 8px; transform-origin: 32px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eExamples:\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: 170px 8px; transform-origin: 170px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e'Macbeth' -\u0026gt; false 'Publius Cornelius Dolabella' -\u0026gt; true\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: 159px 8px; transform-origin: 159px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eNote: sometimes it's the littlest things that matter....\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = two_b_or_not_two_b(x)\r\n  y = true;\r\nend","test_suite":"%%\r\nx = 'Macbeth';\r\ny_correct = false;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))\r\n\r\n%%\r\nx = 'Publius Cornelius Dolabella';\r\ny_correct = true;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))\r\n\r\n%%\r\nx = 'B is not the same as b';\r\ny_correct = true;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))\r\n\r\n%%\r\nx = 'Boba fett is a Star Wars character';\r\ny_correct = true;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))\r\n\r\n%%\r\nx = 'I''m buying a Balloon and going in a bus';\r\ny_correct = false;\r\nassert(isequal(two_b_or_not_two_b(x),y_correct))","published":true,"deleted":false,"likes_count":4,"comments_count":8,"created_by":1022,"edited_by":223089,"edited_at":"2023-03-02T14:13:24.000Z","deleted_by":null,"deleted_at":null,"solvers_count":410,"test_suite_updated_at":"2023-03-02T14:13:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-16T05:20:41.000Z","updated_at":"2026-02-20T14:35:25.000Z","published_at":"2012-02-16T05:20:41.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a string input, output true if there are 2 b's in it, false if otherwise\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\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e'Macbeth' -\u0026gt; false 'Publius Cornelius Dolabella' -\u0026gt; true\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: sometimes it's the littlest things that matter....\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":2946,"title":"Where is she?","description":"Given the numbers 12, 3, 6, 9 \r\n\r\nTell where the girl is located. That is:\r\n\r\nLook to your 3 o'clock = look right\r\n\r\nExample\r\n\r\n x = 3\r\n\r\n fprintf('Look Right \\n')","description_html":"\u003cp\u003eGiven the numbers 12, 3, 6, 9\u003c/p\u003e\u003cp\u003eTell where the girl is located. That is:\u003c/p\u003e\u003cp\u003eLook to your 3 o'clock = look right\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e x = 3\u003c/pre\u003e\u003cpre\u003e fprintf('Look Right \\n')\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 12;\r\ny_correct = 'Look Up';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 'Look Right';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 6;\r\ny_correct = 'Look Back';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 9;\r\ny_correct = 'Look Left';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":33703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":115,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-04T18:44:59.000Z","updated_at":"2026-02-18T10:54:39.000Z","published_at":"2015-02-04T18:44:59.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the numbers 12, 3, 6, 9\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\u003eTell where the girl is located. That is:\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\u003eLook to your 3 o'clock = look right\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[ x = 3\\n\\n fprintf('Look Right \\\\n')]]\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":2688,"title":"Keep Only the Upper characters in a string ","description":"Keep Only the Upper characters in a string \r\n\r\ns = 'Sreeram Mohan'; \r\n\r\noutput = SM;\r\n","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 134.5px 8px; transform-origin: 134.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eKeep Only the Upper characters in a string\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: 67px 8px; transform-origin: 67px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003es = 'Sreeram Mohan';\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: 40px 8px; transform-origin: 40px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eoutput = SM;\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%WEAR A MASK AND STAY HOME\r\nend","test_suite":"%%\r\nx = 'Stay Home, Stay Safe!';\r\ny_correct = 'SHSS';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'Sreeram Mohan';\r\ny_correct = 'SM';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'North Carolina';\r\ny_correct = 'NC';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'The Quick Brown Fox jumps over the Lazy Dog';\r\ny_correct = 'TQBFLD';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'guitars are cool';\r\nassert(isempty(your_fcn_name(x)))\r\n\r\n%%\r\nx = 'I AM BATMAN';\r\ny_correct = 'IAMBATMAN';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'I have the high ground';\r\ny_correct = 'I';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'JUMbled leTTer$ anD NUMBers';\r\ny_correct = 'JUMTTDNUMB'\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'COVID19';\r\ny_correct = 'COVID';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'The name’s Bond. James Bond.';\r\ny_correct = 'TBJB';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'football is a sport';\r\nassert(isempty(your_fcn_name(x)))\r\n\r\n%%\r\nx = 'The Sun IS a staR';\r\ny_correct = 'TSISR';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'National Aeonautics and Space Administration';\r\ny_correct = 'NASA';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'ThIs QuItE a RaNdOm SeNtEnCe';\r\ny_correct = 'TIQIERNOSNEC';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":3946,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2021-05-08T05:47:36.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-11-24T12:00:27.000Z","updated_at":"2026-03-04T16:08:37.000Z","published_at":"2014-11-24T12:00:27.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\u003eKeep Only the Upper characters in a string\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\u003es = 'Sreeram Mohan';\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\u003eoutput = SM;\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":1271,"title":"THE CALCULATOR OF LOVE","description":"In honor of Valentine's Day, program a love calculator that figures out the percentage of compatibility between two people using their names! The algorithm should be as follows:\r\n\r\n* Compile the unique characters of both names\r\n* Sum their ASCII values\r\n* Divide by 101\r\n* The remainder is the match percentage!\r\n\r\nEnjoy! And may cupid have mercy on your love life.","description_html":"\u003cp\u003eIn honor of Valentine's Day, program a love calculator that figures out the percentage of compatibility between two people using their names! The algorithm should be as follows:\u003c/p\u003e\u003cul\u003e\u003cli\u003eCompile the unique characters of both names\u003c/li\u003e\u003cli\u003eSum their ASCII values\u003c/li\u003e\u003cli\u003eDivide by 101\u003c/li\u003e\u003cli\u003eThe remainder is the match percentage!\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eEnjoy! And may cupid have mercy on your love life.\u003c/p\u003e","function_template":"function score = love_calculator(name1, name2)\r\n  score = [name1 name2];\r\nend","test_suite":"%%\r\nassert(love_calculator('Jay-Z','Beyonce')==5)\r\n\r\n%%\r\nassert(love_calculator('Dr. Dre','Eminem')==47)\r\n\r\n%%\r\nassert(love_calculator('Angelina Jolie','Brad Pitt')==69)\r\n\r\n%%\r\nassert(love_calculator('Jennifer Aniston','Brad Pitt')==75)\r\n\r\n%%\r\nassert(love_calculator('God','Satan')==82)\r\n\r\n%%\r\nassert(love_calculator('Your Mom','Your Dad')==5)\r\n\r\n%%\r\nassert(love_calculator('@bmtran','MATLAB')==66)\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":86,"test_suite_updated_at":"2013-02-14T19:15:26.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-02-14T19:05:06.000Z","updated_at":"2026-03-04T16:10:15.000Z","published_at":"2013-02-14T19:12: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn honor of Valentine's Day, program a love calculator that figures out the percentage of compatibility between two people using their names! The algorithm should be as follows:\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\u003eCompile the unique characters of both names\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\u003eSum their ASCII values\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\u003eDivide by 101\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe remainder is the match percentage!\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\u003eEnjoy! And may cupid have mercy on your love life.\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":1191,"title":"Will there be a new leader?","description":"Simply answer the title.","description_html":"\u003cp\u003eSimply answer the title.\u003c/p\u003e","function_template":"function y = wholeads(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx=1\r\ny_correct = 'depends';\r\nassert(isequal(wholeads(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":9554,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":376,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-01-09T20:38:07.000Z","updated_at":"2026-03-29T19:46:06.000Z","published_at":"2013-01-09T20:38:07.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eSimply answer the title.\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":2475,"title":"Case-insensitive Character Detection","description":"Find the index of a particular character in a string ignoring case.\r\n\r\nExample\r\n\r\n Input:   x = 'aAbhhfdf'\r\n          n = 'a'\r\n\r\n Output:  1 2\r\n\r\nBecause in x, at position 1 and 2 , we have a (ignoring case)","description_html":"\u003cp\u003eFind the index of a particular character in a string ignoring case.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e Input:   x = 'aAbhhfdf'\r\n          n = 'a'\u003c/pre\u003e\u003cpre\u003e Output:  1 2\u003c/pre\u003e\u003cp\u003eBecause in x, at position 1 and 2 , we have a (ignoring case)\u003c/p\u003e","function_template":"function y = indexString(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx='aAbhhfdf';\r\nn='a';\r\ny_correct = [1 2];\r\nassert(isequal(indexString(x,n),y_correct))\r\n\r\n%%\r\nx='IndiA';\r\nn='a';\r\ny_correct = [5];\r\nassert(isequal(indexString(x,n),y_correct));\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":63,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-07-31T13:32:09.000Z","updated_at":"2026-03-17T07:52:06.000Z","published_at":"2014-07-31T13:32: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the index of a particular character in a string ignoring case.\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:   x = 'aAbhhfdf'\\n          n = 'a'\\n\\n Output:  1 2]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBecause in x, at position 1 and 2 , we have a (ignoring case)\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":2625,"title":"Shorten pathname","description":"Given a pathname string, return a condensed version by replacing intermediate folders with '..'.\r\n\r\n*Example*\r\n\r\nIf\r\n\r\n  fullpath = 'C:\\foo\\bar\\baz\\qux';\r\n\r\nthen\r\n\r\n  shortpath = 'C:\\..\\qux';","description_html":"\u003cp\u003eGiven a pathname string, return a condensed version by replacing intermediate folders with '..'.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003efullpath = 'C:\\foo\\bar\\baz\\qux';\r\n\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eshortpath = 'C:\\..\\qux';\r\n\u003c/pre\u003e","function_template":"function y = shorten(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'C:\\foo\\bar\\baz\\qux';\r\nassert(isequal(shorten(x),'C:\\..\\qux'))\r\n\r\n%%\r\nx = 'this\\is\\just\\a\\test';\r\nassert(isequal(shorten(x),'this\\..\\test'))\r\n\r\n%%\r\nx = 'testing\\testing\\123.mat';\r\nassert(isequal(shorten(x),'testing\\..\\123.mat'))\r\n\r\n%%\r\nx = 'testing\\t1\\t2\\t3\\t4\\t5\\t6\\t7\\t8\\t9\\t10\\123.mat';\r\nassert(isequal(shorten(x),'testing\\..\\123.mat'))\r\n\r\n%%\r\nx = 'corp.company_name.com\\dir1\\dir2\\dir3\\dir4\\file';\r\nassert(isequal(shorten(x),'corp.company_name.com\\..\\file'))\r\n\r\n%%\r\nx = 'dir1\\dir2\\dir3\\d.txt';\r\nassert(isequal(shorten(x),'dir1\\..\\d.txt'))\r\n\r\n%%\r\nx = 'dir1\\dir#2\\dir_3\\dir%4\\dir(5)\\dir+6\\d.txt';\r\nassert(isequal(shorten(x),'dir1\\..\\d.txt'))","published":true,"deleted":false,"likes_count":5,"comments_count":1,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":92,"test_suite_updated_at":"2017-09-27T16:08:09.000Z","rescore_all_solutions":false,"group_id":32,"created_at":"2014-10-11T04:40:47.000Z","updated_at":"2026-03-19T19:57:55.000Z","published_at":"2014-10-11T04:40:47.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 pathname string, return a condensed version by replacing intermediate folders with '..'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[fullpath = 'C:\\\\foo\\\\bar\\\\baz\\\\qux';]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[shortpath = 'C:\\\\..\\\\qux';]]\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":42421,"title":"Reverse a string","description":"Reverse the given string.\r\n\r\nExample\r\n\r\n input  = 'reverse'\r\n output = 'esrever'","description_html":"\u003cp\u003eReverse the given string.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e input  = 'reverse'\r\n output = 'esrever'\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'gadag';\r\ny_correct = 'gadag';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'gadaga';\r\ny_correct = 'agadag';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'once upon a yraerd thgindim';\r\ny_correct = 'midnight dreary a nopu ecno';\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":5,"created_by":45461,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":216,"test_suite_updated_at":"2015-07-15T17:11:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-06-26T06:16:21.000Z","updated_at":"2026-02-18T14:23:45.000Z","published_at":"2015-06-26T06:16:21.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\u003eReverse the given string.\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  = 'reverse'\\n output = 'esrever']]\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":44619,"title":"Capitalized string operations","description":"Convert the input sentence to upper case and replace all vowels with an underscore ('_') ","description_html":"\u003cp\u003eConvert the input sentence to upper case and replace all vowels with an underscore ('_')\u003c/p\u003e","function_template":"function y = upper_replace(Documents)\r\n  y = x;\r\nend","test_suite":"%%\r\nDocuments = 'These are sample tests on a sentence';\r\ny_correct = 'TH_S_ _R_ S_MPL_ T_STS _N _ S_NT_NC_';\r\nassert(isequal(upper_replace(Documents),y_correct))\r\n\r\n%%\r\nDocuments = 'This is an underscore: _';\r\ny_correct = 'TH_S _S _N _ND_RSC_R_: _';\r\nassert(isequal(upper_replace(Documents),y_correct))","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":51,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-04-20T06:13:50.000Z","updated_at":"2026-03-17T11:42:25.000Z","published_at":"2018-04-20T06:13:50.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\u003eConvert the input sentence to upper case and replace all vowels with an underscore ('_')\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":1461,"title":"Duplicate a character ","description":"Duplicate a character 'n' times.\r\n\r\nExample 1: str='a' n=5\r\n\r\noutput='aaaaa'\r\n\r\nExample 2: str='*' n=3\r\n\r\noutput='***'\r\n\r\n","description_html":"\u003cp\u003eDuplicate a character 'n' times.\u003c/p\u003e\u003cp\u003eExample 1: str='a' n=5\u003c/p\u003e\u003cp\u003eoutput='aaaaa'\u003c/p\u003e\u003cp\u003eExample 2: str='*' n=3\u003c/p\u003e\u003cp\u003eoutput='***'\u003c/p\u003e","function_template":"function y = duplicate_char(str,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nstr = 'b';n=5\r\ny_correct = 'bbbbb';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n\r\n%%\r\nstr = 's';n=1\r\ny_correct = 's';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n\r\n%%\r\nstr = 'b';n=10\r\ny_correct = 'bbbbbbbbbb';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n\r\n%%\r\nstr = 'b';n=0\r\ny_correct = '';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n%%\r\nstr = '?';n=2\r\ny_correct = '??';\r\nassert(isequal(duplicate_char(str,n),y_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":3,"created_by":1023,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":245,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-04-26T01:35:19.000Z","updated_at":"2026-02-18T15:15:38.000Z","published_at":"2013-04-26T01:35: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\",\"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\u003eDuplicate a character 'n' times.\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 1: str='a' n=5\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\u003eoutput='aaaaa'\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 2: str='*' n=3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput='***'\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":44296,"title":"String Delimination and Outputting","description":"In this problem, take an incoming string and deliminate the string based on spaces. Output the first string in between the spaces (i.e. 'apple pear' becomes 'apple' 'pear' for str output 1 and 2, final output is 'apple')","description_html":"\u003cp\u003eIn this problem, take an incoming string and deliminate the string based on spaces. Output the first string in between the spaces (i.e. 'apple pear' becomes 'apple' 'pear' for str output 1 and 2, final output is 'apple')\u003c/p\u003e","function_template":"function [str1, str2] = your_fcn_name(delim_str)\r\n  str1 = ...;\r\n  str2 = ...;\r\nend","test_suite":"%%\r\ndelim_str = 'apple pear';\r\nstr1 = 'apple';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = 'apple pear pineapple';\r\nstr1 = 'apple';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = 'one';\r\nstr1 = 'one';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = 'one two three';\r\nstr1 = 'one';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = '123 456';\r\nstr1 = '123';\r\nassert(isequal(your_fcn_name(delim_str),str1))\r\n\r\n%%\r\ndelim_str = '123456';\r\nstr1 = '123456';\r\nassert(isequal(your_fcn_name(delim_str),str1))","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":64,"test_suite_updated_at":"2017-09-08T19:24:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:56:06.000Z","updated_at":"2026-03-16T10:06:15.000Z","published_at":"2017-09-06T00:56: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\u003eIn this problem, take an incoming string and deliminate the string based on spaces. Output the first string in between the spaces (i.e. 'apple pear' becomes 'apple' 'pear' for str output 1 and 2, final output is 'apple')\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":44420,"title":"文字列の最初と最後の文字だけ抜き出しましょう。","description":"文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。\r\nもし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\r\n\r\n例:\r\n\r\n   stringfirstandlast('boring example') = 'be'\r\n\r\n* (英語版) Problem 649. Return the first and last character of a string\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/649\u003e\r\n","description_html":"\u003cp\u003e文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。\r\nもし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。\u003c/p\u003e\u003cp\u003e例:\u003c/p\u003e\u003cpre\u003e   stringfirstandlast('boring example') = 'be'\u003c/pre\u003e\u003cul\u003e\u003cli\u003e(英語版) Problem 649. Return the first and last character of a string \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/649\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/649\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = stringfirstandlast(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'abcde';\r\ny_correct = 'ae';\r\nassert(isequal(stringfirstandlast(x),y_correct))\r\n%%\t\r\nx = 'a';\r\ny_correct = 'aa';\r\nassert(isequal(stringfirstandlast(x),y_correct))\r\n%%\t\r\nx = 'codyrocks!';\r\ny_correct = 'c!';\r\nassert(isequal(stringfirstandlast(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":11824,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":348,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":36,"created_at":"2017-11-28T06:51:19.000Z","updated_at":"2026-03-16T19:35:37.000Z","published_at":"2017-11-28T06:51: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\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\u003e例:\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[   stringfirstandlast('boring example') = 'be']]\u003e\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\u003e(英語版) Problem 649. Return the first and last character of a string\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/649\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/649\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\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":2143,"title":"reverse string","description":"input='rama'\r\noutput='amar'","description_html":"\u003cp\u003einput='rama'\r\noutput='amar'\u003c/p\u003e","function_template":"function y = rs(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = char([97:1:122]);\r\ny_correct = char([122:-1:97]);\r\nassert(isequal(rs(x),y_correct))\r\n%%\r\nx = 'HOW';\r\ny_correct = 'WOH';\r\nassert(isequal(rs(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1690,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":384,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-01-31T07:15:47.000Z","updated_at":"2026-02-18T14:52:20.000Z","published_at":"2014-01-31T07:15:47.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\u003einput='rama' output='amar'\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":2141,"title":"execute the declaration in strings and return value","description":"execute the commands in strings and return value\r\n\r\ninput='a=23'\r\noutput=23","description_html":"\u003cp\u003eexecute the commands in strings and return value\u003c/p\u003e\u003cp\u003einput='a=23'\r\noutput=23\u003c/p\u003e","function_template":"function y = stringed_commands(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'a=45';\r\ny_correct = 45;\r\nassert(isequal(stringed_commands(x),y_correct))\r\n%%\r\nx = 'a=908';\r\ny_correct = 908;\r\nassert(isequal(stringed_commands(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":1690,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":61,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-01-31T03:11:10.000Z","updated_at":"2026-03-24T12:09:35.000Z","published_at":"2014-01-31T03:11:10.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eexecute the commands in strings and return value\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\u003einput='a=23' output=23\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":45991,"title":"Find the position of planet in solarsystem","description":"Write a funtion named *nthplanet* which takes name of the planet as input string and provides the position of the planet, starting from *Mercury* at *1st* position and *Neptune* at *8th* , as output.(For those who are sad because I ignored Pluto, Pluto is considered as Dwarf planet by IAU)\r\n\r\nIf\r\n\r\n  x = 'Earth'\r\n\r\nthen\r\n\r\n  nthplanet(x)\r\n\r\ngives\r\n\r\n  3\r\n\r\nPlease have a look at the Testsuite before you begin","description_html":"\u003cp\u003eWrite a funtion named \u003cb\u003enthplanet\u003c/b\u003e which takes name of the planet as input string and provides the position of the planet, starting from \u003cb\u003eMercury\u003c/b\u003e at \u003cb\u003e1st\u003c/b\u003e position and \u003cb\u003eNeptune\u003c/b\u003e at \u003cb\u003e8th\u003c/b\u003e , as output.(For those who are sad because I ignored Pluto, Pluto is considered as Dwarf planet by IAU)\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = 'Earth'\r\n\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003enthplanet(x)\r\n\u003c/pre\u003e\u003cp\u003egives\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e3\r\n\u003c/pre\u003e\u003cp\u003ePlease have a look at the Testsuite before you begin\u003c/p\u003e","function_template":"function y = nthplanet(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'earth';\r\ny_correct = 3;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'Neptune';\r\ny_correct = 8;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'MeRcUrY';\r\ny_correct = 1;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'SATURN';\r\ny_correct = 6;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'URAnus';\r\ny_correct = 7;\r\nassert(isequal(nthplanet(x),y_correct))\r\n%%\r\nx = 'MarS';\r\ny_correct = 4;\r\nassert(isequal(nthplanet(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":470183,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":30,"test_suite_updated_at":"2020-06-29T08:54:02.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2020-06-26T07:39:20.000Z","updated_at":"2026-03-31T13:06:22.000Z","published_at":"2020-06-26T07:55: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\u003eWrite a funtion named\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\u003enthplanet\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e which takes name of the planet as input string and provides the position of the planet, starting from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eMercury\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e at\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\u003e1st\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e position 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\u003eNeptune\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e at\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\u003e8th\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , as output.(For those who are sad because I ignored Pluto, Pluto is considered as Dwarf planet by IAU)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[x = 'Earth']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[nthplanet(x)]]\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\u003egives\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[3]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease have a look at the Testsuite before you begin\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":2802,"title":"Count number of words in string","description":"Count number of words in string \r\n\r\nExamples\r\n\r\n 'hi', answer is 1\r\n\r\n 'hi hi', answer is 2\r\n\r\n 'I enjoy cody', answer is 3\r\n","description_html":"\u003cp\u003eCount number of words in string\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e 'hi', answer is 1\u003c/pre\u003e\u003cpre\u003e 'hi hi', answer is 2\u003c/pre\u003e\u003cpre\u003e 'I enjoy cody', answer is 3\u003c/pre\u003e","function_template":"function y = word_count(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'hi';\r\ny_correct = 1;\r\nassert(isequal(word_count(x),y_correct))\r\n%%\r\nx = 'hi hi';\r\ny_correct = 2;\r\nassert(isequal(word_count(x),y_correct))\r\n%%\r\nx = 'I love cody';\r\ny_correct = 3;\r\nassert(isequal(word_count(x),y_correct))\r\n%%\r\nx = 'MATHWORK';\r\ny_correct = 1;\r\nassert(isequal(word_count(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":188,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-27T11:22:01.000Z","updated_at":"2026-02-18T15:24:32.000Z","published_at":"2014-12-27T11:22:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCount number of words in string\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[ 'hi', answer is 1\\n\\n 'hi hi', answer is 2\\n\\n 'I enjoy cody', answer is 3]]\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":60694,"title":"Reverse a string","description":"Return a string with the characters in reverse order from a given input string \r\nEx: \r\nmy_str = \"Ciao\"\r\nfunction should output \"oaiC\"","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: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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: 236.1px 8px; transform-origin: 236.1px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReturn a string with the characters in reverse order from a given input string \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-collapse: preserve; 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: 12.05px 8px; transform-origin: 12.05px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEx: \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-collapse: preserve; 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: 48.3417px 8px; transform-origin: 48.3417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003emy_str = \"Ciao\"\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-collapse: preserve; 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: 89.775px 8px; transform-origin: 89.775px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003efunction should output \"oaiC\"\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = str_opp(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = \"Ciao\";\r\ny_correct = \"oaiC\";\r\nassert(isequal(str_opp(x),y_correct))\r\n%%\r\nx = \"heLLo\";\r\ny_correct = \"oLLeh\";\r\nassert(isequal(str_opp(x),y_correct))\r\n%%\r\nx = [\"MaTlAb\",\"is\",\"fUN\",\"to\",\"work\",\"on\"];\r\ny_correct = [\"bAlTaM\",\"si\",\"NUf\",\"ot\",\"krow\",\"no\"];\r\nassert(isequal(str_opp(x),y_correct))\r\n%%\r\nx = [\"diD\",\"uoY\";\"rehpiceD\",\"sihT\";\"egasseM\",\"?yltcerroC\"];\r\ny_correct = [\"Did\",\"You\";\"Decipher\",\"This\";\"Message\",\"Correctly?\"];\r\nassert(isequal(str_opp(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":4585291,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-08-07T15:43:39.000Z","updated_at":"2026-02-17T15:42:01.000Z","published_at":"2024-08-07T15:43:39.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReturn a string with the characters in reverse order from a given input string \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\u003eEx: \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\u003emy_str = \\\"Ciao\\\"\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\u003efunction should output \\\"oaiC\\\"\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":45985,"title":"Flag a convertible string","description":"If a string is able to be entirely converted to an integer, return a \"true\" flag. Otherwise, return a false flag. For example:\r\na = '32';\r\nisconvertible(a)\r\nWould return logical(1)\r\na = '32f';\r\nisconvertible(a)\r\nWould return logical(0)","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: 184.733px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 92.3667px; transform-origin: 407px 92.3667px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 371.5px 8px; transform-origin: 371.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIf a string is able to be entirely converted to an integer, return a \"true\" flag. Otherwise, return a false flag. For example:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 40.8667px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 20.4333px; transform-origin: 404px 20.4333px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 36px 8.5px; tab-size: 4; transform-origin: 36px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003ea = \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 16px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 16px 8.5px; \"\u003e'32'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 64px 8.5px; tab-size: 4; transform-origin: 64px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eisconvertible(a)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 72px 8px; transform-origin: 72px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWould return logical(1)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 40.8667px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 20.4333px; transform-origin: 404px 20.4333px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 40px 8.5px; tab-size: 4; transform-origin: 40px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003ea = \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 20px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 20px 8.5px; \"\u003e'32f'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 64px 8.5px; tab-size: 4; transform-origin: 64px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eisconvertible(a)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 72px 8px; transform-origin: 72px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWould return logical(0)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = isconvertible(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = '32';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '-1';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '0';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = 'i';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = 'shoosan3';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '-2';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = 'sdaf';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = 'f00';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = num2str(randi(1e3));\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = sprintf('%d%s%d', randi(9), char(randi([65 90])), randi(9));\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = num2str(pi,4);\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '420';\r\ny_correct = true;\r\nassert(isequal(isconvertible(x),y_correct))\r\n%%\r\nx = '$23';\r\ny_correct = false;\r\nassert(isequal(isconvertible(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":157354,"edited_by":223089,"edited_at":"2023-04-15T06:05:40.000Z","deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":"2023-04-15T06:05:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-23T22:04:06.000Z","updated_at":"2026-03-04T14:59:45.000Z","published_at":"2020-06-23T22:04:06.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a string is able to be entirely converted to an integer, return a \\\"true\\\" flag. Otherwise, return a false flag. For example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = '32';\\nisconvertible(a)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWould return logical(1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[a = '32f';\\nisconvertible(a)]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWould return logical(0)\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":54500,"title":"Remove Lower Case Letters","description":"Example\r\nMEMOry --\u003e MEMO\r\nIMPlEMeNtATiON --\u003e IMPEMNATON","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: 700; \"\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eMEMOry --\u0026gt; MEMO\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIMPlEMeNtATiON --\u0026gt; IMPEMNATON\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  y = x;\r\nend","test_suite":"%%\r\nx = 'MEMOry';\r\ny_correct = 'MEMO';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'IMPlEMeNtATiON';\r\ny_correct = 'IMPEMNATON';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":232412,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":276,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-05-04T12:45:52.000Z","updated_at":"2026-03-22T01:00:27.000Z","published_at":"2022-05-04T12:45:52.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMEMOry --\u0026gt; MEMO\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\u003eIMPlEMeNtATiON --\u0026gt; IMPEMNATON\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":1862,"title":"Does this dress make me look fat","description":"For the input string \"Does xyz make me look fat\" output the string \"No, xyz does not make you look fat\"","description_html":"\u003cp\u003eFor the input string \"Does xyz make me look fat\" output the string \"No, xyz does not make you look fat\"\u003c/p\u003e","function_template":"function y = fat(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'Does this dress make me look fat';\r\ny_correct = 'No, this dress does not make you look fat';\r\nassert(isequal(fat(x),y_correct))\r\n%%\r\nx = 'Does this shirt make me look fat';\r\ny_correct = 'No, this shirt does not make you look fat';\r\nassert(isequal(fat(x),y_correct))\r\n%%\r\nx = 'Does my hair make me look fat';\r\ny_correct = 'No, my hair does not make you look fat';\r\nassert(isequal(fat(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":7800,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":"2016-05-11T18:55:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-09-06T22:46:07.000Z","updated_at":"2026-03-04T15:31:51.000Z","published_at":"2016-05-11T18:55:41.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 the input string \\\"Does xyz make me look fat\\\" output the string \\\"No, xyz does not make you look fat\\\"\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":409,"title":"Back to basics 19 - character types","description":"Covering some basic topics I haven't seen elsewhere on Cody.\r\n\r\nReturn the number of punctuation characters in the input variable.","description_html":"\u003cp\u003eCovering some basic topics I haven't seen elsewhere on Cody.\u003c/p\u003e\u003cp\u003eReturn the number of punctuation characters in the input variable.\u003c/p\u003e","function_template":"function y = punctuation(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 'This is cool!';\r\ny_correct = 1;\r\nassert(isequal(punctuation(x),y_correct))\r\n\r\n%%\r\nx = '!?! Are you kidding !?!';\r\ny_correct = 6;\r\nassert(isequal(punctuation(x),y_correct))\r\n\r\n%%\r\nx = 'Nope....';\r\ny_correct = 4;\r\nassert(isequal(punctuation(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":1022,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":274,"test_suite_updated_at":"2012-02-25T16:29:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-25T16:29:32.000Z","updated_at":"2026-03-16T10:59:28.000Z","published_at":"2012-02-25T16:29:32.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\u003eCovering some basic topics I haven't seen elsewhere on Cody.\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\u003eReturn the number of punctuation characters in the input variable.\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":43084,"title":"Combine the digits to output numbers","description":"input could be of any length\r\ne.g.\r\n1.\r\nin1 = 1\r\nin2 = 2\r\noutput = 12\r\n2.\r\nin1 = 2\r\nin2 = 1\r\nin3 = 0\r\noutput = 210","description_html":"\u003cp\u003einput could be of any length\r\ne.g.\r\n1.\r\nin1 = 1\r\nin2 = 2\r\noutput = 12\r\n2.\r\nin1 = 2\r\nin2 = 1\r\nin3 = 0\r\noutput = 210\u003c/p\u003e","function_template":"function y = combineUs(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\nb = 2;\r\ny_correct = 12;\r\nassert(isequal(combineUs(x,b),y_correct))\r\n%%\r\nx = 2;\r\nb = 1;\r\nc = 0;\r\ny_correct = 210;\r\nassert(isequal(combineUs(x,b,c),y_correct))\r\n%%\r\nx = 1;\r\nb = 3;\r\nc = 0;\r\nd = 9\r\ny_correct = 1309;\r\nassert(isequal(combineUs(x,b,c,d),y_correct))\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":0,"created_by":13865,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2016-10-29T17:10:41.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-06T01:14:27.000Z","updated_at":"2026-03-11T15:43:45.000Z","published_at":"2016-10-06T01:17:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput could be of any length e.g. 1. in1 = 1 in2 = 2 output = 12 2. in1 = 2 in2 = 1 in3 = 0 output = 210\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":288,"title":"Construct a string from letters and counts","description":"Given two input arrays like this:\r\n    [5,3,1]\r\n    ['a','b','c']\r\n\r\nOutput a string that contains each letter the specified number of times, e.g.:\r\n\r\n    'aaaaabbbc'\r\n\r\nIf given an invalid input (for example, a negative number), output the string 'ERROR'.","description_html":"\u003cp\u003eGiven two input arrays like this:\r\n    [5,3,1]\r\n    ['a','b','c']\u003c/p\u003e\u003cp\u003eOutput a string that contains each letter the specified number of times, e.g.:\u003c/p\u003e\u003cpre\u003e    'aaaaabbbc'\u003c/pre\u003e\u003cp\u003eIf given an invalid input (for example, a negative number), output the string 'ERROR'.\u003c/p\u003e","function_template":"function y = construct_string(lengths, letters)\r\n  y = 'ERROR';\r\nend\r\n","test_suite":"%%\r\nx = []; y = [];\r\ny_correct = 'ERROR';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n%%\r\nx = [-1]; y = ['a'];\r\ny_correct = 'ERROR';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n%%\r\nx = ['a']; y = [5];\r\ny_correct = 'ERROR';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n%%\r\nr = 10+randi(20); x = [r 1]; y = 'ab';\r\ny_correct(1:r) = 'a'; y_correct(r+1) = 'b';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n%%\r\nx = [5 4 3 2 1];\r\ny = '.#4a5';\r\ny_correct = '.....####444aa5';\r\nassert(isequal(construct_string(x,y),y_correct))\r\n\r\n%%\r\nx1 = [1 1 1 1 1 1];\r\ny = 'banana';\r\nassert(isequal(construct_string(x1,y),y))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":78,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":147,"test_suite_updated_at":"2012-02-08T19:06:38.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-08T17:07:24.000Z","updated_at":"2026-03-16T11:02:54.000Z","published_at":"2012-02-08T19:12:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two input arrays like this: [5,3,1] ['a','b','c']\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOutput a string that contains each letter the specified number of times, e.g.:\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[    'aaaaabbbc']]\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\u003eIf given an invalid input (for example, a negative number), output the string 'ERROR'.\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":44852,"title":"Mean number of letters per word (Easy)","description":"Given a character array, s, representing a sentence, return a, the arithmetic mean of the number of letters per word in the given sentence. Round your answer to three decimal digits.\r\n\r\nYou may make the following assumptions:\r\n\r\n1. All characters in the array are either letters or spaces.\r\n\r\n2. There are no redundant spaces.\r\n\r\n3. Except for spaces, there is no punctuation in the sentence.\r\n\r\n4. There will always be at least two words in the sentence.\r\n\r\nExample:\r\n\r\n  c = 'The quick brown fox jumps over the lazy dog';\r\n  \r\n  a = 3.889;\r\n\r\nExample:\r\n\r\n  c = 'Another one bites the dust';\r\n  \r\n  a = 4.400;\r\n\r\nThe next problem in this series is \u003chttps://www.mathworks.com/matlabcentral/cody/problems/44853-mean-number-of-letters-per-word-hard Problem 44853\u003e.","description_html":"\u003cp\u003eGiven a character array, s, representing a sentence, return a, the arithmetic mean of the number of letters per word in the given sentence. Round your answer to three decimal digits.\u003c/p\u003e\u003cp\u003eYou may make the following assumptions:\u003c/p\u003e\u003cp\u003e1. All characters in the array are either letters or spaces.\u003c/p\u003e\u003cp\u003e2. There are no redundant spaces.\u003c/p\u003e\u003cp\u003e3. Except for spaces, there is no punctuation in the sentence.\u003c/p\u003e\u003cp\u003e4. There will always be at least two words in the sentence.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ec = 'The quick brown fox jumps over the lazy dog';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ea = 3.889;\r\n\u003c/pre\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ec = 'Another one bites the dust';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ea = 4.400;\r\n\u003c/pre\u003e\u003cp\u003eThe next problem in this series is \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/44853-mean-number-of-letters-per-word-hard\"\u003eProblem 44853\u003c/a\u003e.\u003c/p\u003e","function_template":"function a = your_fcn_name(c)\r\n    a = 0;\r\nend","test_suite":"%%\r\nfiletext = fileread('your_fcn_name.m');\r\nassert(isempty(strfind(filetext,'eval')))\r\nassert(isempty(strfind(filetext,'echo')))\r\nassert(isempty(strfind(filetext,'switch')))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('Hello world'),5.000))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('The quick brown fox jumps over the lazy dog'),3.889))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('Another one bites the dust'),4.400))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('Antidisestablishmentarianism is the longest nonscientific word in the English language'),7.700))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('I ate pudding'),3.667))\r\n\r\n%%\r\nassert(isequal(your_fcn_name('I hate pudding'),4.000))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":15521,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":36,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":65,"created_at":"2019-02-16T20:34:25.000Z","updated_at":"2026-03-24T12:02:15.000Z","published_at":"2019-02-16T21:25: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\",\"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 character array, s, representing a sentence, return a, the arithmetic mean of the number of letters per word in the given sentence. Round your answer to three decimal digits.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou may make the following assumptions:\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. All characters in the array are either letters or spaces.\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. There are no redundant spaces.\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\u003e3. Except for spaces, there is no punctuation in the sentence.\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\u003e4. There will always be at least two words in the sentence.\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[c = 'The quick brown fox jumps over the lazy dog';\\n\\na = 3.889;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\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[c = 'Another one bites the dust';\\n\\na = 4.400;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe next problem in this series is\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/44853-mean-number-of-letters-per-word-hard\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 44853\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44512,"title":"Find if a given sentence is a palindrome","description":"Given a string/character array, return true if the string is a palindrome else returns false.\r\n\r\nFor example:\r\n\r\n  sample_text = \"Sore was I ere I saw Eros.\";\r\n  isPalindrome(sample_text);\r\n  ans =\r\n        True \r\n","description_html":"\u003cp\u003eGiven a string/character array, return true if the string is a palindrome else returns false.\u003c/p\u003e\u003cp\u003eFor example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003esample_text = \"Sore was I ere I saw Eros.\";\r\nisPalindrome(sample_text);\r\nans =\r\n      True \r\n\u003c/pre\u003e","function_template":"function y = isPalindrome(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = \"Nella's simple hymn: \"\"I attain my help, Miss Allen.\";\r\ny_correct = true;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx = \"Deliver desserts,\"\" demanded Nemesis, \"\"emended, named, stressed, reviled.\";\r\ny_correct = true;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx = \"Dennis danced\";\r\ny_correct = false;\r\nassert(isequal(isPalindrome(x),y_correct))\r\n\r\n%%\r\nx = \"Fred ate bread\";\r\ny_correct = false;\r\nassert(isequal(isPalindrome(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":132561,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":"2018-02-07T10:05:57.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-02-05T11:44:20.000Z","updated_at":"2026-03-24T12:04:28.000Z","published_at":"2018-02-05T11:44:28.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a string/character array, return true if the string is a palindrome else returns 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\u003eFor example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[sample_text = \\\"Sore was I ere I saw Eros.\\\";\\nisPalindrome(sample_text);\\nans =\\n      True]]\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":1638,"title":"JOIN STRINGS","description":"There are two given strings 'STRING1' and 'STR ING2'.|monospaced|The output should be 'STRING1 STR ING2' or STr1='Sum';STr2='EQUALS';STr3='MATLAB', then output should be 'Sum EQUALS MATLAB'.","description_html":"\u003cp\u003eThere are two given strings 'STRING1' and 'STR ING2'.|monospaced|The output should be 'STRING1 STR ING2' or STr1='Sum';STr2='EQUALS';STr3='MATLAB', then output should be 'Sum EQUALS MATLAB'.\u003c/p\u003e","function_template":"function y = your_fcn_name(varargin)\r\n  y = x;\r\nend","test_suite":"%%\r\nstr='MATLABian';\r\nstr1='My name';\r\nstr3='kjhsdfs';\r\ny_correct ='MATLABian My name kjhsdfs';\r\nassert(strcmp(your_fcn_name(str,str1,str3),y_correct)==1)\r\n\r\n%%\r\nstr='This';\r\nstr1='is';\r\nstr3='MATLAB';\r\ny_correct ='This is MATLAB';\r\nassert(strcmp(your_fcn_name(str,str1,str3),y_correct)==1)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":13514,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":75,"test_suite_updated_at":"2013-06-10T08:44:11.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-06-10T08:29:23.000Z","updated_at":"2025-10-02T10:44:35.000Z","published_at":"2013-06-10T08:29:23.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere are two given strings 'STRING1' and 'STR ING2'.|monospaced|The output should be 'STRING1 STR ING2' or STr1='Sum';STr2='EQUALS';STr3='MATLAB', then output should be 'Sum EQUALS 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":408,"title":"Back to basics 18 - justification","description":"Covering some basic topics I haven't seen elsewhere on Cody.\r\n\r\nGiven a string with extra spaces in front and/or in back, return a 'centered' version of the string (e.g.: '    MATLAB' -\u003e '  MATLAB  ')","description_html":"\u003cp\u003eCovering some basic topics I haven't seen elsewhere on Cody.\u003c/p\u003e\u003cp\u003eGiven a string with extra spaces in front and/or in back, return a 'centered' version of the string (e.g.: '    MATLAB' -\u003e '  MATLAB  ')\u003c/p\u003e","function_template":"function y = justify(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = '    MATLAB';\r\ny_correct = '  MATLAB  ';\r\nassert(isequal(justify(x),y_correct))\r\n\r\n%%\r\nx = 'MATLAB    ';\r\ny_correct = '  MATLAB  ';\r\nassert(isequal(justify(x),y_correct))\r\n\r\n\r\n%%\r\nx = ' MATLAB   ';\r\ny_correct = '  MATLAB  ';\r\nassert(isequal(justify(x),y_correct))\r\n\r\n%%\r\nx = ' MATLAB ';\r\ny_correct = ' MATLAB ';\r\nassert(isequal(justify(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":1022,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":207,"test_suite_updated_at":"2012-02-25T16:24:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-25T16:24:36.000Z","updated_at":"2026-04-05T02:02:04.000Z","published_at":"2012-02-25T16:24: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\",\"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\u003eCovering some basic topics I haven't seen elsewhere on Cody.\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\u003eGiven a string with extra spaces in front and/or in back, return a 'centered' version of the string (e.g.: ' MATLAB' -\u003e ' 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":44004,"title":"Get chain of consecutive characters","description":"Write a function that will output a chain of consecutive characters, given 2 letters as input. It has to work backwards too. Examples:\r\n\r\n\u003e\u003e get_char_list('a', 'f')\r\nabcdef\r\n\u003e\u003e get_char_list('p', 'q')\r\npq\r\n\u003e\u003e get_char_list('x', 't')\r\nxwvut","description_html":"\u003cp\u003eWrite a function that will output a chain of consecutive characters, given 2 letters as input. It has to work backwards too. Examples:\u003c/p\u003e\u003cp\u003e\u0026gt;\u0026gt; get_char_list('a', 'f')\r\nabcdef\r\n\u0026gt;\u0026gt; get_char_list('p', 'q')\r\npq\r\n\u0026gt;\u0026gt; get_char_list('x', 't')\r\nxwvut\u003c/p\u003e","function_template":"function y = get_char_list(first,last)\r\n  y = first;\r\nend","test_suite":"%%\r\nfirst='a';\r\nlast='f';\r\nassert(isequal(get_char_list(first,last),'abcdef'))\r\n%%\r\nfirst='x';\r\nlast='t';\r\nassert(isequal(get_char_list(first,last),'xwvut'))\r\n%%\r\nfirst='p';\r\nlast='p';\r\nassert(isequal(get_char_list(first,last),'p'))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":109067,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-01-14T18:47:52.000Z","updated_at":"2026-03-16T11:08:25.000Z","published_at":"2017-01-14T18:47:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eWrite a function that will output a chain of consecutive characters, given 2 letters as input. It has to work backwards too. Examples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u0026gt; get_char_list('a', 'f') abcdef \u0026gt;\u0026gt; get_char_list('p', 'q') pq \u0026gt;\u0026gt; get_char_list('x', 't') xwvut\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":1249,"title":"first step for Huffman Coding (easy)","description":"Given a string, you must sort the characters by occurrence (from lowest to highest).\r\n\r\nThis step is necessary to generate a Huffman tree. ( \u003chttp://en.wikipedia.org/wiki/Huffman_coding\u003e )\r\n\r\nAll characters must be taken into account. Capitals are not taken into account.\r\n\r\nIf two characters appear the same number of times, the order does not matter.\r\n\r\n\r\nYou will return two arrays:\r\n\r\nthe first comprising the characters sorted.\r\nthe second comprising the number of occurrence of characters of the first array.\r\n\r\n\r\n\r\nExample : \r\n\r\ninput : \r\n\r\n    input = 'aAabbC';\r\n\r\noutput : \r\n\r\n_characters :_ \r\n\r\n  cha =\r\n  \r\n  c\r\n  b\r\n  a\r\n  \r\n\r\n_occurence :_\r\n\r\n  occ =\r\n  \r\n       1\r\n       2\r\n       3\r\n","description_html":"\u003cp\u003eGiven a string, you must sort the characters by occurrence (from lowest to highest).\u003c/p\u003e\u003cp\u003eThis step is necessary to generate a Huffman tree. ( \u003ca href=\"http://en.wikipedia.org/wiki/Huffman_coding\"\u003ehttp://en.wikipedia.org/wiki/Huffman_coding\u003c/a\u003e )\u003c/p\u003e\u003cp\u003eAll characters must be taken into account. Capitals are not taken into account.\u003c/p\u003e\u003cp\u003eIf two characters appear the same number of times, the order does not matter.\u003c/p\u003e\u003cp\u003eYou will return two arrays:\u003c/p\u003e\u003cp\u003ethe first comprising the characters sorted.\r\nthe second comprising the number of occurrence of characters of the first array.\u003c/p\u003e\u003cp\u003eExample :\u003c/p\u003e\u003cp\u003einput :\u003c/p\u003e\u003cpre\u003e    input = 'aAabbC';\u003c/pre\u003e\u003cp\u003eoutput :\u003c/p\u003e\u003cp\u003e\u003ci\u003echaracters :\u003c/i\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003echa =\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ec\r\nb\r\na\r\n\u003c/pre\u003e\u003cp\u003e\u003ci\u003eoccurence :\u003c/i\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eocc =\r\n\u003c/pre\u003e\u003cpre\u003e       1\r\n       2\r\n       3\u003c/pre\u003e","function_template":"function [cha occ] = sortHuffman(input)\r\n\r\n  cha=input;\r\n  occ = 0;\r\n\r\nend","test_suite":"%%\r\ninput = 'CoDy';\r\n[cha occ] = sortHuffman(input);\r\ncha_control = ['c';'d';'o';'y'];\r\n\r\nassert(isequal(size(cha),size(cha_control)));\r\nassert(isequal(sum(lower(input)),sum(occ.*(cha+0))));\r\nassert(all(sort(occ)==occ));\r\n\r\n\r\n%%\r\ninput = 'abcd abc ab a';\r\n[cha occ] = sortHuffman(input);\r\ncha_control = ['d';'c';' ';'b';'a'];\r\n\r\nassert(isequal(size(cha),size(cha_control)));\r\nassert(isequal(sum(lower(input)),sum(occ.*(cha+0))));\r\nassert(all(sort(occ)==occ));\r\n\r\n\r\n%%\r\ninput = 'La regression PLS (Partial Least Squares regression) est une technique d analyse et de prediction relativement recente. Elle a ete concue pour faire face aux problemes resultants de l insuffisance de l utilisation de la regression lineaire classique, qui trouve ses limites des lors que l on cherche a modeliser des relations entre des variables pour lesquelles il y a peu d individus, ou beaucoup de variables explicatives en comparaison au nombre d individus (le nombre de variables explicatives pouvant exceder tres largement le nombre d individus), ou encore lorsque les variables explicatives sont fortement correlees entre elles.';\r\n\r\n[cha occ] = sortHuffman(input);\r\n\r\ncha_control =['(';')';'.';'y';',';'h';'g';'f';'x';'q';'b';'m';'p';'v';'c';'d';'u';'o';'t';'n';'a';'l';'r';'i';'s';'e';' '];\r\n\r\nassert(isequal(size(cha),size(cha_control)));\r\nassert(isequal(sum(lower(input)),sum(occ.*(cha+0))));\r\nassert(all(sort(occ)==occ));","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":8073,"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":"2013-02-05T14:26:46.000Z","updated_at":"2026-03-16T13:53:37.000Z","published_at":"2013-02-05T14:26:46.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a string, you must sort the characters by occurrence (from lowest to highest).\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\u003eThis step is necessary to generate a Huffman tree. (\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Huffman_coding\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Huffman_coding\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e )\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAll characters must be taken into account. Capitals are not taken into account.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf two characters appear the same number of times, the order does not matter.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou will return two arrays:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethe first comprising the characters sorted. the second comprising the number of occurrence of characters of the first array.\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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput :\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 = 'aAabbC';]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput :\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003echaracters :\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[cha =\\n\\nc\\nb\\na]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eoccurence :\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[occ =\\n\\n       1\\n       2\\n       3]]\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":44661,"title":"Remove white spaces at the end of the input string","description":"Remove all trailing white spaces at the end of the input strings","description_html":"\u003cp\u003eRemove all trailing white spaces at the end of the input strings\u003c/p\u003e","function_template":"function y = rem_trail_ws(A)\r\n  A\r\nend","test_suite":"%%\r\nA = 'This is a test string.             ';\r\ny_correct = 'This is a test string.';\r\nassert(isequal(rem_trail_ws(A),y_correct))\r\n\r\n%%\r\nA = '          Testing function rem_trail_ws';\r\ny_correct = '          Testing function rem_trail_ws';\r\nassert(isequal(rem_trail_ws(A),y_correct))\r\n\r\n%%\r\nA = {'MATLAB    ','SIMULINK    ';\r\n     'Toolboxes    ','MathWorks    '};\r\ny_correct = {'MATLAB','SIMULINK';\r\n     'Toolboxes','MathWorks'};\r\nassert(isequal(rem_trail_ws(A),y_correct))\r\n\r\n%%\r\nA = sprintf('MATHWORKS \\t');\r\ny_correct = 'MATHWORKS';\r\nassert(isequal(rem_trail_ws(A),y_correct))","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":54,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-29T14:21:22.000Z","updated_at":"2025-12-07T18:25:49.000Z","published_at":"2018-05-29T14:21:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRemove all trailing white spaces at the end of the input strings\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":51755,"title":"Make the first letter of a sentence Capital.","description":"In this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You will not be given a string with any names. You have to keep all the spaces, symbols as they are given, except the first letter of the sentence.\r\nHappy coding!!!","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: 93px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 46.5px; transform-origin: 407px 46.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 31.5px; text-align: left; transform-origin: 384px 31.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 379.5px 8px; transform-origin: 379.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You will not be given a string with any names. You have to keep all the spaces, symbols as they are given, except the first letter of the sentence.\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: 50.5px 8px; transform-origin: 50.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eHappy coding!!!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = making_capital(x)\r\n\r\nend","test_suite":"%%\r\nx = 'hello everyone. how are you? its a nice day for walk';\r\ny_correct = 'Hello everyone. How are you? Its a nice day for walk';\r\nassert(isequal(making_capital(x),y_correct))\r\n\r\n%%\r\nx = 'long long day ago there was a king. he was very kind to his people. people loved him very much';\r\ny_correct = 'Long long day ago there was a king. He was very kind to his people. People loved him very much';\r\nassert(isequal(making_capital(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1022097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":25,"test_suite_updated_at":"2021-07-16T06:51:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-05-12T16:33:03.000Z","updated_at":"2026-03-09T03:03:53.000Z","published_at":"2021-05-17T06:20:52.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\u003eIn this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You will not be given a string with any names. You have to keep all the spaces, symbols as they are given, except the first letter of the sentence.\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\u003eHappy coding!!!\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":61028,"title":"The Case of the Missing Prototype – Extract the Culprit’s Name from a Mixed Letter-and-Number Email Message","description":"While tracing the suspect’s digital footprint, you recover an email containing a mixed string of letters and numbers.The letters spell out the sender’s name, while the numbers are irrelevant noise.\r\nGiven a string msg, extract only the letters and return them in order to reveal the culprit’s name.\r\nThis small clue may finally tell you who sent the message!","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; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 102px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 51px; transform-origin: 408px 51px; 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: 385px 21px; text-align: left; transform-origin: 385px 21px; white-space-collapse: preserve; 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWhile tracing the suspect’s digital footprint, you recover an email containing a \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003emixed string of letters and numbers\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.The letters spell out the sender’s name, while the numbers are irrelevant noise.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a string \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003emsg\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, extract \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eonly the letters\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and return them in order to reveal the culprit’s name.\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: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis small clue may finally tell you \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ewho sent the message\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = extractName(msg)\r\n  y = x;\r\nend","test_suite":"%%\r\nmsg = 'r2i1t3i0k';\r\ny_correct = 'ritik';\r\nassert(isequal(extractName(msg),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":4953963,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":54,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-10-20T17:00:48.000Z","updated_at":"2026-04-03T04:00:39.000Z","published_at":"2025-10-20T17:00:48.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWhile tracing the suspect’s digital footprint, you recover an email containing a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emixed string of letters and numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.The letters spell out the sender’s name, while the numbers are irrelevant noise.\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\u003eGiven a string \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emsg\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, extract \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eonly the letters\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and return them in order to reveal the culprit’s name.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis small clue may finally tell you \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewho sent the message\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\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":44669,"title":"Dial Up","description":"Each number on telephone keypads, except 0 and 1, corresponds to a set of uppercase letters as shown in this list:\r\n2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ\r\nHence, a phone-number specification can include uppercase letters and digits. Write a function called dial that takes as its input argument a char vector of length 16 or less that includes only these characters and returns as its output argument the telephone number as a uint64. \r\n\r\n*Here is the input and output for one example of a call of the function:\r\n\r\nInput: '1FUNDOG4YOU'\r\nOutput: 13863644968*\r\nYou can assume that a phone number never starts with 0. If the input contains any illegal characters, the function returns 0.","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: 225px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 112.5px; transform-origin: 407px 112.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 84px; 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: 371px 8px; transform-origin: 371px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEach number on telephone keypads, except 0 and 1, corresponds to a set of uppercase letters as shown in this list: 2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ Hence, a phone-number specification can include uppercase letters and digits. Write a function called dial that takes as its input argument a char vector of length 16 or less that includes only these characters and returns as its output argument the telephone number as a uint64.\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: 218px 8px; transform-origin: 218px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e*Here is the input and output for one example of a call of the function:\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=\"\"\u003eInput: '1FUNDOG4YOU' \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: 74px 8px; transform-origin: 74px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOutput: 13863644968* \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: 381.5px 8px; transform-origin: 381.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYou can assume that a phone number never starts with 0. If the input contains any illegal characters, the function returns 0.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"%function to convert a string into corresponding phone number\r\nfunction out = dial(inp)\r\n\r\nend","test_suite":"%%\r\ninp = '1WEAR2A3MASK4';\r\nout_correct = 1932722362754;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = '1FUNDOG4YOU';\r\nout_correct = 13863644968;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = '1 (FUN) DOG-4-YOU #2';\r\nout_correct = 0;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = '6C89YEAH47SUP2JK';\r\nout_correct = 6289932447787255;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = '8YO1HEY9USA';\r\nout_correct = 89614399872;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = 'ST4Y H0ME,ST4Y S4FE';\r\nout_correct = 0;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = 'CH59PIV4BMW32';\r\nout_correct = 2459748426932;\r\nassert(isequal(dial(inp),out_correct))\r\n\r\n%%\r\ninp = 'GOLD (1$) SHINNY';\r\nout_correct = 0;\r\nassert(isequal(dial(inp),out_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":"2021-05-04T14:18:01.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2018-05-30T10:39:23.000Z","updated_at":"2025-12-07T21:22:17.000Z","published_at":"2018-05-30T10:39:23.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\u003eEach number on telephone keypads, except 0 and 1, corresponds to a set of uppercase letters as shown in this list: 2 ABC, 3 DEF, 4 GHI, 5 JKL, 6 MNO, 7 PQRS, 8 TUV, 9 WXYZ Hence, a phone-number specification can include uppercase letters and digits. Write a function called dial that takes as its input argument a char vector of length 16 or less that includes only these characters and returns as its output argument the telephone number as a uint64.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e*Here is the input and output for one example of a call of the function:\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\u003eInput: '1FUNDOG4YOU' \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\u003eOutput: 13863644968* \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou can assume that a phone number never starts with 0. If the input contains any illegal characters, the function returns 0.\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":552,"title":"Cell Array Inception?","description":"Jimmy is a beginning MATLAB student who is trying to read in a text file and build a cell array of strings, where A{k} is the kth line of the text file.  He writes the following code, and is confused when it doesn't work:\r\n\r\n  fid = fopen('myfile.txt','r');\r\n  A = {};\r\n  while ~feof(fid)\r\n      A = {A fgetl(fid)};\r\n  end\r\n\r\nWhat he finds is that after the loop, A only has two components, no matter what the file length.  The second component is the last line of the file, and the first component is another cell array!  He then realizes that A{1} also has two components, where the second component is the second-last line of the file and the first component is yet another cell array!\r\n\r\nYour task: write a function to undo this \"cell-array Inception\" and return the proper cell array of strings that Jimmy is looking for.  Implement B = unInception(A), where A is the cell array as returned by Jimmy's code.\r\n","description_html":"\u003cp\u003eJimmy is a beginning MATLAB student who is trying to read in a text file and build a cell array of strings, where A{k} is the kth line of the text file.  He writes the following code, and is confused when it doesn't work:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003efid = fopen('myfile.txt','r');\r\nA = {};\r\nwhile ~feof(fid)\r\n    A = {A fgetl(fid)};\r\nend\r\n\u003c/pre\u003e\u003cp\u003eWhat he finds is that after the loop, A only has two components, no matter what the file length.  The second component is the last line of the file, and the first component is another cell array!  He then realizes that A{1} also has two components, where the second component is the second-last line of the file and the first component is yet another cell array!\u003c/p\u003e\u003cp\u003eYour task: write a function to undo this \"cell-array Inception\" and return the proper cell array of strings that Jimmy is looking for.  Implement B = unInception(A), where A is the cell array as returned by Jimmy's code.\u003c/p\u003e","function_template":"function B = unInception(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nx = {{{{{{{{} 'hello'} 'world'} 'this'} 'is'} 'a'} 'string'} 'array'};\r\ny_correct = {'hello' 'world' 'this' 'is' 'a' 'string' 'array'};\r\nassert(isequal(unInception(x),y_correct))\r\n%%\r\nx = {};\r\ny_correct = {};\r\nassert(isequal(unInception(x),y_correct))\r\n%%\r\nx = {{} ''};\r\ny_correct = {''};\r\nassert(isequal(unInception(x),y_correct))\r\n%%\r\nx = {{{{} 'hello'} ''} 'yeah'};\r\ny_correct = {'hello' '' 'yeah'};\r\nassert(isequal(unInception(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":1537,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":30,"test_suite_updated_at":"2012-04-03T04:47:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-04-03T04:47:52.000Z","updated_at":"2025-12-29T14:38:50.000Z","published_at":"2012-04-03T04:47:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eJimmy is a beginning MATLAB student who is trying to read in a text file and build a cell array of strings, where A{k} is the kth line of the text file. He writes the following code, and is confused when it doesn't work:\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[fid = fopen('myfile.txt','r');\\nA = {};\\nwhile ~feof(fid)\\n    A = {A fgetl(fid)};\\nend]]\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\u003eWhat he finds is that after the loop, A only has two components, no matter what the file length. The second component is the last line of the file, and the first component is another cell array! He then realizes that A{1} also has two components, where the second component is the second-last line of the file and the first component is yet another cell array!\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\u003eYour task: write a function to undo this \\\"cell-array Inception\\\" and return the proper cell array of strings that Jimmy is looking for. Implement B = unInception(A), where A is the cell array as returned by Jimmy's code.\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":42677,"title":"Print the date for a given number using Indian calendar reference","description":"Print date for a given number in date reference is INDIAN calendar, not Christ's Birth\r\n\r\nThe Vikram Samvat is said to have been founded by the emperor Vikramaditya of Malwa following his victory over the Sakas in 56 Years, 8 Months, 17 Days BCE. Output Format is dd/mm/yyyy.","description_html":"\u003cp\u003ePrint date for a given number in date reference is INDIAN calendar, not Christ's Birth\u003c/p\u003e\u003cp\u003eThe Vikram Samvat is said to have been founded by the emperor Vikramaditya of Malwa following his victory over the Sakas in 56 Years, 8 Months, 17 Days BCE. Output Format is dd/mm/yyyy.\u003c/p\u003e","function_template":"function y = date_in(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = '31/08/0056';\r\nassert(isequal(date_in(x),y_correct))\r\n%% \r\nx = 736268;\r\ny_correct = '30/06/2072';\r\nassert(isequal(date_in(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":28123,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-10-31T15:58:30.000Z","updated_at":"2026-03-16T10:33:03.000Z","published_at":"2015-10-31T15:58:41.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\u003ePrint date for a given number in date reference is INDIAN calendar, not Christ's Birth\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 Vikram Samvat is said to have been founded by the emperor Vikramaditya of Malwa following his victory over the Sakas in 56 Years, 8 Months, 17 Days BCE. Output Format is dd/mm/yyyy.\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":54495,"title":"Remove Upper Case Letters","description":"Example\r\nMatlab --\u003e atlab\r\nproBlem --\u003e prolem\r\nEnter --\u003e nter","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: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-weight: 700; \"\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eMatlab --\u0026gt; atlab\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eproBlem --\u0026gt; prolem\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eEnter --\u0026gt; nter\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  y = x;\r\nend","test_suite":"%%\r\nx = 'Matlab';\r\ny_correct = 'atlab';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'Cody';\r\ny_correct = 'ody';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'meMbers';\r\ny_correct = 'mebers';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 'ReSEmBlAncE';\r\ny_correct = 'emlnc';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":232412,"edited_by":232412,"edited_at":"2022-05-04T12:32:45.000Z","deleted_by":null,"deleted_at":null,"solvers_count":278,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-05-04T12:31:50.000Z","updated_at":"2026-03-20T14:09:36.000Z","published_at":"2022-05-04T12:32:45.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMatlab --\u0026gt; atlab\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\u003eproBlem --\u0026gt; prolem\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\u003eEnter --\u0026gt; nter\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":1560,"title":"COUNT VOWEL 2","description":"The objective of this problem is to determine the number of unique vowels used in the given string.\r\n\r\n Now count vowels in STRING.\r\n\r\nEXAMPLE:\r\n\r\n STRING='We are the MaTLaBins'; then OUTPUT is 3\r\n\r\nor,\r\n\r\n STRING='LaBoRaToRy'; then OUTPUT will be 2","description_html":"\u003cp\u003eThe objective of this problem is to determine the number of unique vowels used in the given string.\u003c/p\u003e\u003cpre\u003e Now count vowels in STRING.\u003c/pre\u003e\u003cp\u003eEXAMPLE:\u003c/p\u003e\u003cpre\u003e STRING='We are the MaTLaBins'; then OUTPUT is 3\u003c/pre\u003e\u003cp\u003eor,\u003c/p\u003e\u003cpre\u003e STRING='LaBoRaToRy'; then OUTPUT will be 2\u003c/pre\u003e","function_template":"function y = VOWEL_COUNTER2(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx='We are the MaTLaBins';\r\ny_correct = 3;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='ThiS iS tHe MaTLaB CoDiNg';\r\ny_correct = 4;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='eDuCaTioN';\r\ny_correct = 5;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='LaBoRaToRy';\r\ny_correct = 2;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='Deleted';\r\ny_correct = 1;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))\r\n\r\n%%\r\nx='Dltd';\r\ny_correct = 0;\r\nassert(isequal(VOWEL_COUNTER2(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":13514,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":84,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-06-06T11:04:24.000Z","updated_at":"2025-11-13T17:56:30.000Z","published_at":"2013-06-06T11:04:32.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe objective of this problem is to determine the number of unique vowels used in the given string.\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[ Now count vowels in STRING.]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE:\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[ STRING='We are the MaTLaBins'; then OUTPUT is 3]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eor,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ STRING='LaBoRaToRy'; then OUTPUT will be 2]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44730,"title":"Substring Extraction","description":"In a given string, find the substring between Start_string and End_string. \r\n\r\nYou will have to include or exclude the Start_string and End_string as a part of the substring depending on the third argument 'include_se'\r\n\r\nIf include_se=1, include the Start_string and End_string as a part of the extracted substring, else exclude them\r\n\r\nExample: \r\n\r\n  input_str: 'This is a test sentence'\r\n  Start_string: 'is'\r\n  End_string: 'sentence'\r\n  include_se=1\r\n  extract_function(input_str,Start_string,End_string, include_se)= 'is a test sentence'\r\n","description_html":"\u003cp\u003eIn a given string, find the substring between Start_string and End_string.\u003c/p\u003e\u003cp\u003eYou will have to include or exclude the Start_string and End_string as a part of the substring depending on the third argument 'include_se'\u003c/p\u003e\u003cp\u003eIf include_se=1, include the Start_string and End_string as a part of the extracted substring, else exclude them\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003einput_str: 'This is a test sentence'\r\nStart_string: 'is'\r\nEnd_string: 'sentence'\r\ninclude_se=1\r\nextract_function(input_str,Start_string,End_string, include_se)= 'is a test sentence'\r\n\u003c/pre\u003e","function_template":"function output_str = extract_function(input_str,Start_string,End_string, include_se)\r\n\r\nend","test_suite":"%%\r\ninput_str= 'This is a test sentence'\r\nStart_string= ' is'\r\nEnd_string= 'sentence'\r\ninclude_se=1\r\noutput_str= {' is a test sentence'}\r\nassert(isequal(extract_function(input_str,Start_string,End_string, include_se),output_str))\r\n\r\n%%\r\ninput_str= 'This is a test sentence'\r\nStart_string= ' is'\r\nEnd_string= 'sentence'\r\ninclude_se=0\r\noutput_str={' a test '}\r\nassert(isequal(extract_function(input_str,Start_string,End_string, include_se),output_str))\r\n\r\n%%\r\ninput_str= 'Right now!I said RIGHT NOW!'\r\nStart_string= 'now!'\r\nEnd_string= '!'\r\ninclude_se=0\r\noutput_str={'I said RIGHT NOW'}\r\nassert(isequal(extract_function(input_str,Start_string,End_string, include_se),output_str))","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":31,"test_suite_updated_at":"2018-08-16T12:54:54.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-08-16T12:52:30.000Z","updated_at":"2025-12-29T13:54:03.000Z","published_at":"2018-08-16T12:52: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\u003eIn a given string, find the substring between Start_string and End_string.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou will have to include or exclude the Start_string and End_string as a part of the substring depending on the third argument 'include_se'\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf include_se=1, include the Start_string and End_string as a part of the extracted substring, else exclude them\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_str: 'This is a test sentence'\\nStart_string: 'is'\\nEnd_string: 'sentence'\\ninclude_se=1\\nextract_function(input_str,Start_string,End_string, include_se)= 'is a test sentence']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"strings\"","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:\"strings\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"strings\"","","\"","strings","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad028\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f4f4b6abcc8\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f4f4b6a8528\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad528\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad488\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad3e8\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f4f4b6ad348\u003e":"tag:\"strings\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad348\u003e":"tag:\"strings\""},"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:\"strings\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"strings\"","","\"","strings","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad028\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f4f4b6abcc8\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f4f4b6a8528\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad528\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad488\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad3e8\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f4f4b6ad348\u003e":"tag:\"strings\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f4f4b6ad348\u003e":"tag:\"strings\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":43280,"difficulty_rating":"easy"},{"id":44294,"difficulty_rating":"easy"},{"id":44295,"difficulty_rating":"easy"},{"id":43232,"difficulty_rating":"easy"},{"id":42592,"difficulty_rating":"easy"},{"id":44297,"difficulty_rating":"easy"},{"id":44620,"difficulty_rating":"easy"},{"id":44548,"difficulty_rating":"easy"},{"id":44662,"difficulty_rating":"easy"},{"id":60699,"difficulty_rating":"easy"},{"id":1741,"difficulty_rating":"easy"},{"id":1230,"difficulty_rating":"easy"},{"id":325,"difficulty_rating":"easy"},{"id":2946,"difficulty_rating":"easy"},{"id":2688,"difficulty_rating":"easy"},{"id":1271,"difficulty_rating":"easy"},{"id":1191,"difficulty_rating":"easy"},{"id":2475,"difficulty_rating":"easy"},{"id":2625,"difficulty_rating":"easy"},{"id":42421,"difficulty_rating":"easy"},{"id":44619,"difficulty_rating":"easy"},{"id":1461,"difficulty_rating":"easy"},{"id":44296,"difficulty_rating":"easy"},{"id":44420,"difficulty_rating":"easy"},{"id":2143,"difficulty_rating":"easy"},{"id":2141,"difficulty_rating":"easy"},{"id":45991,"difficulty_rating":"easy"},{"id":2802,"difficulty_rating":"easy"},{"id":60694,"difficulty_rating":"easy"},{"id":45985,"difficulty_rating":"easy"},{"id":54500,"difficulty_rating":"easy"},{"id":1862,"difficulty_rating":"easy"},{"id":409,"difficulty_rating":"easy"},{"id":43084,"difficulty_rating":"easy"},{"id":288,"difficulty_rating":"easy"},{"id":44852,"difficulty_rating":"easy"},{"id":44512,"difficulty_rating":"easy"},{"id":1638,"difficulty_rating":"easy"},{"id":408,"difficulty_rating":"easy-medium"},{"id":44004,"difficulty_rating":"easy-medium"},{"id":1249,"difficulty_rating":"easy-medium"},{"id":44661,"difficulty_rating":"easy-medium"},{"id":51755,"difficulty_rating":"easy-medium"},{"id":61028,"difficulty_rating":"easy-medium"},{"id":44669,"difficulty_rating":"easy-medium"},{"id":552,"difficulty_rating":"easy-medium"},{"id":42677,"difficulty_rating":"easy-medium"},{"id":54495,"difficulty_rating":"easy-medium"},{"id":1560,"difficulty_rating":"easy-medium"},{"id":44730,"difficulty_rating":"easy-medium"}]}}