{"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":43009,"title":"Back to Basics - New Data Type in R2016b - convert a char to a string","description":"Convert an char array into a string.\r\n\r\n","description_html":"\u003cp\u003eConvert an char array into a string.\u003c/p\u003e","function_template":"function y = convert2string(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx ='abcdef';\r\ny_correct = string(x)\r\nassert((convert2string(x)==y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":4690,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":101,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-03T17:41:53.000Z","updated_at":"2026-02-09T16:08:02.000Z","published_at":"2016-10-03T17:41:53.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 an char array into a 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":43672,"title":"String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values","description":"\u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html String array\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\r\n\r\nTo begin with, let's assume that there are no missing type values in the input string array. \r\n\r\nExample: \r\n\r\n  Input:\r\n  \u003e\u003e x = string({'I','love','MATLAB'})\r\n  x = \r\n    1×3 string array\r\n      \"I\"    \"love\"    \"MATLAB\";\r\n\r\n  Output:\r\n  \u003e\u003e y = {'I','love','MATLAB'}\r\n  y =\r\n    1×3 cell array\r\n      'I'    'love'    'MATLAB';\r\n\r\nRelated Problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values   String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003e \r\n* String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values   String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003e\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values   String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003e","description_html":"\u003cp\u003e\u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eString array\u003c/a\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\u003c/p\u003e\u003cp\u003eTo begin with, let's assume that there are no missing type values in the input string array.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\n\u0026gt;\u0026gt; x = string({'I','love','MATLAB'})\r\nx = \r\n  1×3 string array\r\n    \"I\"    \"love\"    \"MATLAB\";\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\n\u0026gt;\u0026gt; y = {'I','love','MATLAB'}\r\ny =\r\n  1×3 cell array\r\n    'I'    'love'    'MATLAB';\r\n\u003c/pre\u003e\u003cp\u003eRelated Problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\"\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\"\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\"\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = str2cell(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = string({'I','love','MATLAB'});\r\ny_correct = {'I','love','MATLAB'};\r\nassert(isequal(str2cell(x),y_correct))\r\n\r\n%%\r\nx = string({'I','love','MATLAB';'I','love','Cody'});\r\ny_correct = {'I','love','MATLAB'\r\n             'I','love','Cody'};\r\nassert(isequal(str2cell(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":153,"test_suite_updated_at":"2016-11-23T06:40:34.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-21T01:00:23.000Z","updated_at":"2026-03-10T19:51:47.000Z","published_at":"2016-11-22T21:10: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:hyperlink w:docLocation=\\\"http://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo begin with, let's assume that there are no missing type values in the input string 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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Input:\\n\u003e\u003e x = string({'I','love','MATLAB'})\\nx = \\n  1×3 string array\\n    \\\"I\\\"    \\\"love\\\"    \\\"MATLAB\\\";\\n\\nOutput:\\n\u003e\u003e y = {'I','love','MATLAB'}\\ny =\\n  1×3 cell array\\n    'I'    'love'    'MATLAB';]]\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\u003eRelated Problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing 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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43662,"title":"Use R2016b Text Manipulations to Fix These Addresses (Part 3)","description":"\r\nWe have a series of addresses like the following which we'd like to reformat. Each of the addresses lacks a space and a comma between the street name (which always ends with a period) and the neighborhood/city name. Can you insert a space between these?\r\n\r\n*Example:*\r\n\r\n  Input:\r\n  adrIn = '950 Blue Hill Ave.Dorchester, MA 02124';\r\n\r\n  Output:\r\n  adrOut = '950 Blue Hill Ave., Dorchester, MA 02124';\r\n\r\n*Feature Tip:* \r\n\r\n\u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html  MATLAB Characters and Strings\u003e.\r\n\r\n*Background:* \r\n\r\nDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003chttps://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak here\u003e or import it into MATLAB with |webread|.\r\n\r\n  data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\r\n*Related Problems:*\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1 Use R2016b Text Manipulations to Fix These Addresses (Part 1)\u003e\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2 Use R2016b Text Manipulations to Fix These Addresses (Part 2)\u003e\r\n\r\nUse R2016b Text Manipulations to Fix These Addresses (Part 3)","description_html":"\u003cp\u003eWe have a series of addresses like the following which we'd like to reformat. Each of the addresses lacks a space and a comma between the street name (which always ends with a period) and the neighborhood/city name. Can you insert a space between these?\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\nadrIn = '950 Blue Hill Ave.Dorchester, MA 02124';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\nadrOut = '950 Blue Hill Ave., Dorchester, MA 02124';\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eMATLAB Characters and Strings\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eBackground:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003ca href = \"https://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\"\u003ehere\u003c/a\u003e or import it into MATLAB with \u003ctt\u003ewebread\u003c/tt\u003e.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003edata = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/p\u003e","function_template":"function adrOut = myFun(adrIn)\r\n  adrOut = adrIn;\r\nend","test_suite":"%%\r\nx = '950 Blue Hill Ave.Dorchester, MA 02124';\r\ny = string('950 Blue Hill Ave., Dorchester, MA 02124');\r\nassert (all(y == myFun(x)));\r\n\r\n%%\r\nx = '259 Allandale Rd.Jamaica Plain, MA 02467';\r\ny = string('259 Allandale Rd., Jamaica Plain, MA 02467');\r\nassert (all(y == myFun(x)));\r\n\r\n%%\r\nx = '850 Harrison Ave.Boston, MA 02118';\r\ny = string('850 Harrison Ave., Boston, MA 02118');\r\nassert (all(y == myFun(x)));\r\n\r\n%%\r\nx = '23-29 Tucker St.Dorchester, MA 02124';\r\ny = string('23-29 Tucker St., Dorchester, MA 02124');\r\nassert (all(y == myFun(x)));","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":28291,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":108,"test_suite_updated_at":"2016-11-17T22:09:00.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-17T21:50:07.000Z","updated_at":"2026-03-10T19:38:55.000Z","published_at":"2016-11-17T21:59: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\",\"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\u003eWe have a series of addresses like the following which we'd like to reformat. Each of the addresses lacks a space and a comma between the street name (which always ends with a period) and the neighborhood/city name. Can you insert a space between these?\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Input:\\nadrIn = '950 Blue Hill Ave.Dorchester, MA 02124';\\n\\nOutput:\\nadrOut = '950 Blue Hill Ave., Dorchester, MA 02124';]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces string arrays and text manipulation functions which can help. To learn more see\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://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Characters and Strings\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eBackground:\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\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data\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://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or import it into MATLAB with\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewebread\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\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":43660,"title":"Use R2016b Text Manipulations to Fix These Addresses (Part 1)","description":"We have a series of addresses like the following which we'd like to reformat. Can you remove the latitude and longitude from the addresses?\r\n\r\n*Example:*\r\n\r\n  Input:\r\n  adrIn = '959 Blue Hill Ave.Dorchester, MA 2124(42.29189440573543, -71.0887162019496)';\r\n\r\n  Output:\r\n  adrOut = '950 Blue Hill Ave.Dorchester, MA 2124';\r\n\r\n*Feature Tip:* \r\n\r\n\u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html  MATLAB Characters and Strings\u003e.\r\n\r\n*Background:* \r\n\r\nDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003chttps://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak here\u003e or import it into MATLAB with |webread|.\r\n\r\n  data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\r\n*Related Problems:*\r\n\r\nUse R2016b Text Manipulations to Fix These Addresses (Part 1)\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2 Use R2016b Text Manipulations to Fix These Addresses (Part 2)\u003e\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3 Use R2016b Text Manipulations to Fix These Addresses (Part 3)\u003e","description_html":"\u003cp\u003eWe have a series of addresses like the following which we'd like to reformat. Can you remove the latitude and longitude from the addresses?\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\nadrIn = '959 Blue Hill Ave.Dorchester, MA 2124(42.29189440573543, -71.0887162019496)';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\nadrOut = '950 Blue Hill Ave.Dorchester, MA 2124';\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eMATLAB Characters and Strings\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eBackground:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003ca href = \"https://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\"\u003ehere\u003c/a\u003e or import it into MATLAB with \u003ctt\u003ewebread\u003c/tt\u003e.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003edata = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/a\u003e\u003c/p\u003e","function_template":"function y = myFun(adrIn)\r\n  adrOut = adrIn;\r\nend","test_suite":"%%\r\nx = '950 Blue Hill Ave.Dorchester, MA 2124(42.29189440573543, -71.0887162019496)';\r\ny = string('950 Blue Hill Ave.Dorchester, MA 2124');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx= '259 Allandale Rd.Jamaica Plain, MA 2467(42.30236456682541, -71.14054916195282)';\r\ny = string('259 Allandale Rd.Jamaica Plain, MA 2467');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '850 Harrison Ave.Boston, MA 2118(42.33517814576012, -71.07473087474541)';\r\ny = string('850 Harrison Ave.Boston, MA 2118');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '23-29 Tucker St.Dorchester, MA 2124(42.30786999970087, -71.06340000010977)';\r\ny = string('23-29 Tucker St.Dorchester, MA 2124');\r\nassert (all(y  == myFun(x)));\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":28291,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":125,"test_suite_updated_at":"2016-11-17T22:08:04.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-17T21:37:14.000Z","updated_at":"2026-03-10T19:24:56.000Z","published_at":"2016-11-17T21:58: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\u003eWe have a series of addresses like the following which we'd like to reformat. Can you remove the latitude and longitude from the addresses?\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Input:\\nadrIn = '959 Blue Hill Ave.Dorchester, MA 2124(42.29189440573543, -71.0887162019496)';\\n\\nOutput:\\nadrOut = '950 Blue Hill Ave.Dorchester, MA 2124';]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces string arrays and text manipulation functions which can help. To learn more see\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://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Characters and Strings\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eBackground:\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\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data\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://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or import it into MATLAB with\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewebread\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\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\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43661,"title":"Use R2016b Text Manipulations to Fix These Addresses (Part 2)","description":"\r\nWe have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Massachusetts (MA) and should have a leading '0' before the 2 in the zip code. Can you insert the leading '0'?\r\n\r\n*Example:*\r\n\r\n  Input:\r\n  adrIn = '950 Blue Hill Ave.Dorchester, MA 2124';\r\n\r\n  Output:\r\n  adrOut = '950 Blue Hill Ave.Dorchester, MA 02124';\r\n\r\n*Feature Tip:* \r\n\r\n\u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html  MATLAB Characters and Strings\u003e.\r\n\r\n*Background:* \r\n\r\nDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003chttps://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak here\u003e or import it into MATLAB with |webread|.\r\n\r\n  data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\r\n*Related Problems:*\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1 Use R2016b Text Manipulations to Fix These Addresses (Part 1)\u003e\r\n\r\nUse R2016b Text Manipulations to Fix These Addresses (Part 2)\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3 Use R2016b Text Manipulations to Fix These Addresses (Part 3)\u003e","description_html":"\u003cp\u003eWe have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Massachusetts (MA) and should have a leading '0' before the 2 in the zip code. Can you insert the leading '0'?\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\nadrIn = '950 Blue Hill Ave.Dorchester, MA 2124';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\nadrOut = '950 Blue Hill Ave.Dorchester, MA 02124';\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eMATLAB Characters and Strings\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eBackground:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003ca href = \"https://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\"\u003ehere\u003c/a\u003e or import it into MATLAB with \u003ctt\u003ewebread\u003c/tt\u003e.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003edata = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/a\u003e\u003c/p\u003e","function_template":"function adrOut = myFun(adrIn)\r\n  adrOut = adrIn;\r\nend","test_suite":"%%\r\nx = '950 Blue Hill Ave.Dorchester, MA 2124';\r\ny = string('950 Blue Hill Ave.Dorchester, MA 02124');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '259 Allandale Rd.Jamaica Plain, MA 2467';\r\ny = string('259 Allandale Rd.Jamaica Plain, MA 02467');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '850 Harrison Ave.Boston, MA 2118';\r\ny = string('850 Harrison Ave.Boston, MA 02118');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '23-29 Tucker St.Dorchester, MA 2124';\r\ny = string('23-29 Tucker St.Dorchester, MA 02124');\r\nassert (all(y  == myFun(x)));","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":28291,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":106,"test_suite_updated_at":"2016-11-17T22:08:29.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-17T21:44:56.000Z","updated_at":"2026-03-10T19:31:57.000Z","published_at":"2016-11-17T21:59:04.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Massachusetts (MA) and should have a leading '0' before the 2 in the zip code. Can you insert the leading '0'?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Input:\\nadrIn = '950 Blue Hill Ave.Dorchester, MA 2124';\\n\\nOutput:\\nadrOut = '950 Blue Hill Ave.Dorchester, MA 02124';]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces string arrays and text manipulation functions which can help. To learn more see\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://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Characters and Strings\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eBackground:\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\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data\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://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or import it into MATLAB with\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewebread\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43663,"title":"Combine the first and last names","description":"MATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays of the first names and last names. Your job is to join the first names with the corresponding last names, and output a new string array. \r\n\r\nFor example, if the inputs are\r\n\r\n  firstnames = [\"Donald\"; \"Hillary\"];\r\n  lastnames = [\"Trump\"; \"Clinton\"];\r\n\r\nthe output should be:\r\n\r\n  names = [\"Donald Trump\"; \"Hillary Clinton\"];\r\n\r\n","description_html":"\u003cp\u003eMATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays of the first names and last names. Your job is to join the first names with the corresponding last names, and output a new string array.\u003c/p\u003e\u003cp\u003eFor example, if the inputs are\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003efirstnames = [\"Donald\"; \"Hillary\"];\r\nlastnames = [\"Trump\"; \"Clinton\"];\r\n\u003c/pre\u003e\u003cp\u003ethe output should be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003enames = [\"Donald Trump\"; \"Hillary Clinton\"];\r\n\u003c/pre\u003e","function_template":"function y = fullname(firstnames,lastnames)\r\n  y = [firstnames,lastnames];\r\nend","test_suite":"%%\r\nassessFunctionAbsence('regexp','FileName','fullname.m')\r\n\r\n%%\r\nfirstnames = string({'Donald';'Hillary'});\r\nlastnames = string({'Trump';'Clinton'});\r\ny_correct = string({'Donald Trump';'Hillary Clinton'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))\r\n\r\n%%\r\nfirstnames = string({'Bill','Hillary'});\r\nlastnames = string('Clinton');\r\ny_correct = string({'Bill Clinton','Hillary Clinton'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))\r\n\r\n%%\r\nfirstnames = string({'Donald';'Barron';'Eric'});\r\nlastnames = string('Trump');\r\ny_correct = string({'Donald Trump';'Barron Trump';'Eric Trump'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))\r\n\r\n%%\r\nfirstnames = string('Mike');\r\nlastnames = string({'Tyson','Pence','Trout'});\r\ny_correct = string({'Mike Tyson','Mike Pence','Mike Trout'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))\r\n\r\n%%\r\nfirstnames = string({'Donald','Hillary';'Mike','James'});\r\nlastnames = string({'Trump','Clinton';'Pence','Bond'});\r\ny_correct = string({'Donald Trump','Hillary Clinton';'Mike Pence','James Bond'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))","published":true,"deleted":false,"likes_count":7,"comments_count":2,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":170,"test_suite_updated_at":"2017-09-18T00:54:07.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T09:31:11.000Z","updated_at":"2026-03-10T21:21:28.000Z","published_at":"2016-11-18T09:31:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays of the first names and last names. Your job is to join the first names with the corresponding last names, and output a new string 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\u003eFor example, if the inputs are\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[firstnames = [\\\"Donald\\\"; \\\"Hillary\\\"];\\nlastnames = [\\\"Trump\\\"; \\\"Clinton\\\"];]]\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 output should be:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[names = [\\\"Donald Trump\\\"; \\\"Hillary Clinton\\\"];]]\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":43673,"title":"String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array","description":"\u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html String array\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array of text data. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\r\n\r\nThe \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values  Part 2\u003e assuming no missing values in the input string array is a good starting point. In this problem, the missing values for string arrays, denoted *\u003c missing \u003e*, need to be converted to the missing values for cell arrays, denoted *{''}* (i.e., cell of empty character). \r\n\r\nRefer to the R2016b documentation for more information on the \u003chttp://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing missing values for different data types\u003e.\r\n \r\nExample: \r\n\r\n  Input:\r\n  \u003e\u003e x = string({'I','love'}); x(4) = 'MATLAB'\r\n  x = \r\n    1×4 string array\r\n      \"I\"    \"love\"    \u003cmissing\u003e    \"MATLAB\"\r\n  \r\n  Output:\r\n  \u003e\u003e y = {'I', 'love', '', 'MATLAB'}\r\n  y =\r\n    1×3 cell array\r\n      'I'    'love'    ''    'MATLAB'\r\n\r\nRelated Problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values   String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003e \r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values   String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003e \r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values   String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003e\r\n* String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array","description_html":"\u003cp\u003e\u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eString array\u003c/a\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array of text data. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\u003c/p\u003e\u003cp\u003eThe \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\"\u003ePart 2\u003c/a\u003e assuming no missing values in the input string array is a good starting point. In this problem, the missing values for string arrays, denoted \u003cb\u003e\u0026lt; missing \u0026gt;\u003c/b\u003e, need to be converted to the missing values for cell arrays, denoted \u003cb\u003e{''}\u003c/b\u003e (i.e., cell of empty character).\u003c/p\u003e\u003cp\u003eRefer to the R2016b documentation for more information on the \u003ca href = \"http://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing\"\u003emissing values for different data types\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\n\u0026gt;\u0026gt; x = string({'I','love'}); x(4) = 'MATLAB'\r\nx = \r\n  1×4 string array\r\n    \"I\"    \"love\"    \u0026lt;missing\u0026gt;    \"MATLAB\"\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\n\u0026gt;\u0026gt; y = {'I', 'love', '', 'MATLAB'}\r\ny =\r\n  1×3 cell array\r\n    'I'    'love'    ''    'MATLAB'\r\n\u003c/pre\u003e\u003cp\u003eRelated Problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\"\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\"\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\"\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/a\u003e\u003c/li\u003e\u003cli\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = str2cell(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = string({'I','love','MATLAB'});\r\ny_correct = {'I','love','MATLAB'};\r\nassert(isequal(str2cell(x),y_correct))\r\n\r\n%%\r\nx = string({'I','love'}); x(5) = 'MATLAB';\r\ny_correct = {'I','love','','','MATLAB'};\r\nassert(isequal(str2cell(x),y_correct))\r\n\r\n%%\r\nx = string([1 NaN 2]);\r\ny_correct = {'1','','2'};\r\nassert(isequal(str2cell(x),y_correct))\r\n\r\n%%\r\nx = strings(3);\r\nx(1) = 'first'; \r\nx(end) = 'last';\r\ny_correct = {'first',  '',     ''\r\n             '',       '',     ''\r\n             '',       '',     'last'};\r\nassert(isequal(str2cell(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":119,"test_suite_updated_at":"2016-11-23T06:24:32.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-21T03:52:19.000Z","updated_at":"2026-03-10T20:16:49.000Z","published_at":"2016-11-22T21:16:18.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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:hyperlink w:docLocation=\\\"http://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array of text data. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\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\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://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePart 2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e assuming no missing values in the input string array is a good starting point. In this problem, the missing values for string arrays, denoted\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u0026lt; missing \u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, need to be converted to the missing values for cell arrays, denoted\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e{''}\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (i.e., cell of empty character).\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\u003eRefer to the R2016b documentation for more information on the\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://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emissing values for different data types\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\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:\\n\u003e\u003e x = string({'I','love'}); x(4) = 'MATLAB'\\nx = \\n  1×4 string array\\n    \\\"I\\\"    \\\"love\\\"    \u003cmissing\u003e    \\\"MATLAB\\\"\\n\\nOutput:\\n\u003e\u003e y = {'I', 'love', '', 'MATLAB'}\\ny =\\n  1×3 cell array\\n    'I'    'love'    ''    'MATLAB']]\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\u003eRelated Problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\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":43677,"title":"String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values","description":"\u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html String array\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data. \r\n\r\nTo begin with, let's assume that there are no missing type values in the input cell array. \r\n\r\n\r\nExample: \r\n \r\n\r\n  Input:\r\n  \u003e\u003e x = {'I','Love','MATLAB'}\r\n  x =\r\n    1×3 cell array\r\n      'I'    'Love'    'MATLAB'\r\n\r\n  Output:\r\n  \u003e\u003e y = strings(size(x));\r\n  \u003e\u003e [y{:}] = x{:}\r\n  y = \r\n    1×3 string array\r\n      \"I\"    \"Love\"    \"MATLAB\"\r\n\r\nNote that the example shown above is not the best way to solve this problem. Try other approaches in order to achieve a leading score. \r\n\r\nRelated Problems in this series:\r\n\r\n* String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values   String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003e \r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values   String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003e\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values   String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003e\r\n","description_html":"\u003cp\u003e\u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eString array\u003c/a\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data.\u003c/p\u003e\u003cp\u003eTo begin with, let's assume that there are no missing type values in the input cell array.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\n\u0026gt;\u0026gt; x = {'I','Love','MATLAB'}\r\nx =\r\n  1×3 cell array\r\n    'I'    'Love'    'MATLAB'\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\n\u0026gt;\u0026gt; y = strings(size(x));\r\n\u0026gt;\u0026gt; [y{:}] = x{:}\r\ny = \r\n  1×3 string array\r\n    \"I\"    \"Love\"    \"MATLAB\"\r\n\u003c/pre\u003e\u003cp\u003eNote that the example shown above is not the best way to solve this problem. Try other approaches in order to achieve a leading score.\u003c/p\u003e\u003cp\u003eRelated Problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\"\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\"\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\"\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = cell2str(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = {'I','love','MATLAB'};\r\ny_correct = strings(size(x));\r\n[y_correct{:}] = x{:};\r\nassert(isequal(cell2str(x),y_correct))\r\n\r\n%%\r\nx = {'I',   'love',  'MATLAB'\r\n     'I',   'love',  'Cody'};\r\ny_correct = strings(size(x));\r\n[y_correct{:}] = x{:};\r\nassert(isequal(cell2str(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1969,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-22T21:03:53.000Z","updated_at":"2026-04-01T18:24:18.000Z","published_at":"2016-11-22T21:05: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:hyperlink w:docLocation=\\\"http://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo begin with, let's assume that there are no missing type values in the input 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\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:\\n\u003e\u003e x = {'I','Love','MATLAB'}\\nx =\\n  1×3 cell array\\n    'I'    'Love'    'MATLAB'\\n\\nOutput:\\n\u003e\u003e y = strings(size(x));\\n\u003e\u003e [y{:}] = x{:}\\ny = \\n  1×3 string array\\n    \\\"I\\\"    \\\"Love\\\"    \\\"MATLAB\\\"]]\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\u003eNote that the example shown above is not the best way to solve this problem. Try other approaches in order to achieve a leading score.\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\u003eRelated Problems in this series:\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\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing 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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43666,"title":"Use a timetable to analyze a train timetable (Part 3)","description":"Oh no, you missed your train to Boston (again?)! How many times can you miss that train today? (In other words, how many Boston trains depart on November 1, 2016?)\r\n\r\n*Example* \r\n\r\n  DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\n ArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\n Destination = categorical({'BOS';'NYC';'BOS'});\r\n tt = timetable(DepTime,Destination,ArrTime)\r\n tt = \r\n         DepTime          Destination          ArrTime       \r\n  ____________________    ___________    ____________________\r\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\n\r\n*Feature Tip:* \u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces timetables with related functions which may be helpful. To learn more see \u003chttp://www.mathworks.com/help/matlab/timetables.html MATLAB Timetables\u003e.\r\n\r\n*Related Problems:* \r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1 Use a timetable to analyze a train timetable (Part 1)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2 Use a timetable to analyze a train timetable (Part 2)\u003e\r\n\r\nUse a timetable to analyze a train timetable (Part 3)\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4 Use a timetable to analyze a train timetable (Part 4)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43668-use-a-timetable-to-analyze-a-train-timetable-part-5 Use a timetable to analyze a train timetable (Part 5)\u003e","description_html":"\u003cp\u003eOh no, you missed your train to Boston (again?)! How many times can you miss that train today? (In other words, how many Boston trains depart on November 1, 2016?)\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n       DepTime          Destination          ArrTime       \r\n____________________    ___________    ____________________\r\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e \u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces timetables with related functions which may be helpful. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/timetables.html\"\u003eMATLAB Timetables\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2\"\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43668-use-a-timetable-to-analyze-a-train-timetable-part-5\"\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/a\u003e\u003c/p\u003e","function_template":"function y = myFun(tt)\r\n  y = tt;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\ny = 5;\r\nassert(isequal(myFun(tt),y))\r\n%%\r\nDepTime = datetime(2016,11,[2;1;1;3],[4;10;7;1],[12;53;32;42],0);\r\nArrTime = DepTime + hours(3);\r\nDestination = categorical({'DC';'BOS';'BOS';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\ny = 2;\r\nassert(isequal(myFun(tt),y))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":102743,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":72,"test_suite_updated_at":"2016-11-19T03:02:31.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T20:44:02.000Z","updated_at":"2026-03-10T03:15:48.000Z","published_at":"2016-11-18T20:44:02.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\u003eOh no, you missed your train to Boston (again?)! How many times can you miss that train today? (In other words, how many Boston trains depart on November 1, 2016?)\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\nDestination = categorical({'BOS';'NYC';'BOS'});\\ntt = timetable(DepTime,Destination,ArrTime)\\ntt = \\n       DepTime          Destination          ArrTime       \\n____________________    ___________    ____________________\\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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://www.mathworks.com/help/matlab/timetables.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43668-use-a-timetable-to-analyze-a-train-timetable-part-5\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43665,"title":"Use a timetable to analyze a train timetable (Part 2)","description":"Oh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. You can leave after 6:30 but no later than 9:00. (Today is November 1, 2016)\r\nExample:\r\n DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\n ArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\n Destination = categorical({'BOS';'NYC';'BOS'});\r\n tt = timetable(DepTime,Destination,ArrTime)\r\n tt = \r\n         DepTime          Destination          ArrTime       \r\n  ____________________    ___________    ____________________\r\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\nFeature Tip: R2016b introduces timetables with related functions which may be helpful. To learn more see MATLAB Timetables.\r\nRelated Problems:\r\nUse a timetable to analyze a train timetable (Part 1)\r\nUse a timetable to analyze a train timetable (Part 2)\r\nUse a timetable to analyze a train timetable (Part 3)\r\nUse a timetable to analyze a train timetable (Part 4)\r\nUse a timetable to analyze a train timetable (Part 5)","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: 518.333px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 259.167px; transform-origin: 407px 259.167px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. You can leave after 6:30 but no later than 9:00. (Today is November 1, 2016)\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: 31.5px 8px; transform-origin: 31.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 204.333px; 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 102.167px; transform-origin: 404px 102.167px; 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: 212px 8.5px; tab-size: 4; transform-origin: 212px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\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: 220px 8.5px; tab-size: 4; transform-origin: 220px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e ArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\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: 192px 8.5px; tab-size: 4; transform-origin: 192px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 112px 8.5px; transform-origin: 112px 8.5px; \"\u003e Destination = categorical({\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'BOS'\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\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'NYC'\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\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'BOS'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 12px 8.5px; transform-origin: 12px 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: 176px 8.5px; tab-size: 4; transform-origin: 176px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e tt = timetable(DepTime,Destination,ArrTime)\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: 24px 8.5px; tab-size: 4; transform-origin: 24px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e tt = \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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 104px 8.5px; transform-origin: 104px 8.5px; \"\u003e         DepTime          \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: 44px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 44px 8.5px; \"\u003eDestination\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003e          \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: 28px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 28px 8.5px; \"\u003eArrTime\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 28px 8.5px; transform-origin: 28px 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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 8px 8.5px; transform-origin: 8px 8.5px; \"\u003e  \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 80px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 80px 8.5px; \"\u003e____________________\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 44px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 44px 8.5px; \"\u003e___________\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 80px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 80px 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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 06:22:00    BOS            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 09:17:00\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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 08:51:00    NYC            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 10:32:00\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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 09:05:00    BOS            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 12:09:00\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; 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: 42px 8px; transform-origin: 42px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eFeature Tip:\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eR2016b\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 266px 8px; transform-origin: 266px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e introduces timetables with related functions which may be helpful. To learn more see\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMATLAB Timetables\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 64px 8px; transform-origin: 64px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRelated Problems:\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 161px 8px; transform-origin: 161px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 2)\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function nextTime = myFun(tt)\r\n  nextTime = tt;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,7,39,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n%%\r\nDepTime = datetime(2016,11,[2;1;1;3],[4;10;7;1],[12;53;32;42],0);\r\nArrTime = DepTime + hours(3);\r\nDestination = categorical({'DC';'BOS';'BOS';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,07,32,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n%%\r\nDepTime = datetime(2016,11,[2;1],[6;7],[15;30],0);\r\nArrTime = datetime(2016,11,[2;1],[9;10],[13;31],0);\r\nDestination = categorical([1;1],1,{'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,7,30,0);\r\nassert(isequal(myFun(tt),nextTime))","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":102743,"edited_by":223089,"edited_at":"2022-04-26T19:32:39.000Z","deleted_by":null,"deleted_at":null,"solvers_count":77,"test_suite_updated_at":"2022-04-26T19:32:39.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T20:35:41.000Z","updated_at":"2026-03-10T03:07:32.000Z","published_at":"2016-11-18T20:35:41.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\u003eOh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. You can leave after 6:30 but no later than 9:00. (Today is November 1, 2016)\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: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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\n ArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\n Destination = categorical({'BOS';'NYC';'BOS'});\\n tt = timetable(DepTime,Destination,ArrTime)\\n tt = \\n         DepTime          Destination          ArrTime       \\n  ____________________    ___________    ____________________\\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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\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\u003eRelated Problems:\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:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":43664,"title":"Use a timetable to analyze a train timetable (Part 1)","description":"Oh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. The trip should not take longer than 5 hours.\r\nExample:\r\nDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n         DepTime          Destination          ArrTime       \r\n  ____________________    ___________    ____________________\r\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\nFeature Tip: R2016b introduces timetables with related functions which may be helpful. To learn more see MATLAB Timetables.\r\nRelated Problems:\r\nUse a timetable to analyze a train timetable (Part 1)\r\nUse a timetable to analyze a train timetable (Part 2)\r\nUse a timetable to analyze a train timetable (Part 3)\r\nUse a timetable to analyze a train timetable (Part 4)\r\nUse a timetable to analyze a train timetable (Part 5)","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: 518.333px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 259.167px; transform-origin: 407px 259.167px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. The trip should not take longer than 5 hours.\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: 31.5px 8px; transform-origin: 31.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 204.333px; 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 102.167px; transform-origin: 404px 102.167px; 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: 208px 8.5px; tab-size: 4; transform-origin: 208px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\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: 216px 8.5px; tab-size: 4; transform-origin: 216px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\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: 188px 8.5px; tab-size: 4; transform-origin: 188px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 108px 8.5px; transform-origin: 108px 8.5px; \"\u003eDestination = categorical({\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'BOS'\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\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'NYC'\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\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'BOS'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 12px 8.5px; transform-origin: 12px 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: 172px 8.5px; tab-size: 4; transform-origin: 172px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ett = timetable(DepTime,Destination,ArrTime)\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: 20px 8.5px; tab-size: 4; transform-origin: 20px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ett = \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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 104px 8.5px; transform-origin: 104px 8.5px; \"\u003e         DepTime          \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: 44px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 44px 8.5px; \"\u003eDestination\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003e          \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: 28px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 28px 8.5px; \"\u003eArrTime\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 28px 8.5px; transform-origin: 28px 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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 8px 8.5px; transform-origin: 8px 8.5px; \"\u003e  \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 80px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 80px 8.5px; \"\u003e____________________\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 44px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 44px 8.5px; \"\u003e___________\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 80px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 80px 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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 06:22:00    BOS            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 09:17:00\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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 08:51:00    NYC            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 10:32:00\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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 09:05:00    BOS            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 12:09:00\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; 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: 42px 8px; transform-origin: 42px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eFeature Tip:\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eR2016b\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 266px 8px; transform-origin: 266px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e introduces timetables with related functions which may be helpful. To learn more see\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMATLAB Timetables\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 64px 8px; transform-origin: 64px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRelated Problems:\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: 161px 8px; transform-origin: 161px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function nextTime = myFun(tt)\r\n  nextTime = tt;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,6,22,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n\r\n%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1], [6;6;7;7;8;8],[0;10;0;20;0;30],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1], [13;13;12;12;11;11],[0;30;0;20;0;10],0);\r\nDestination = categorical([1;1;1;1;1;1],1,{'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,8,0,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n\r\n%%\r\nDepTime = datetime(2016,11,[1;2;3;4], [3;5;7;9],0,0);\r\nArrTime = datetime(2016,11,[1;2;3;4], [13;12;11;10],0,0);\r\nDestination = categorical([1;2;1;2],1:2,{'BOS';'NYC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,3,7,0,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n\r\n%%\r\nDepTime = datetime(2016,11,[1;1;1;1], [7;7;8;8],0,0);\r\nArrTime = datetime(2016,11,[1;1;1;1], [12;11;10;9],0,0);\r\nDestination = categorical([1;2;1;2],1:2,{'BOS';'NYC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,8,0,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n\r\n%%\r\nDepTime = datetime(2016,11,[1;1;1;1], [8;8;7;8],10,30);\r\nArrTime = datetime(2016,11,[1;1;1;1], [12;13;10;9],0,0);\r\nDestination = categorical([1;2;1;2],1:2,{'BOS';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,7,10,30);\r\nassert(isequal(myFun(tt),nextTime))","published":true,"deleted":false,"likes_count":2,"comments_count":4,"created_by":102743,"edited_by":223089,"edited_at":"2022-04-27T08:40:00.000Z","deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":"2022-04-27T08:40:00.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T20:20:09.000Z","updated_at":"2026-03-10T02:50:53.000Z","published_at":"2016-11-18T20:26:18.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\u003eOh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. The trip should not take longer than 5 hours.\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: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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\nDestination = categorical({'BOS';'NYC';'BOS'});\\ntt = timetable(DepTime,Destination,ArrTime)\\ntt = \\n         DepTime          Destination          ArrTime       \\n  ____________________    ___________    ____________________\\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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\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\u003eRelated Problems:\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\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":43674,"title":"String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array","description":"\u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html String array\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data. \r\n\r\nThe \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values Part 1\u003e assuming no missing values in the input cell array is a good starting point. In this problem, the missing values for cell array of character vectors, denoted *{''}* (i.e., cell of empty character), need to be converted to the missing values for string arrays, denoted *\u003c missing \u003e*. \r\n\r\nRefer to the R2016b documentation for more information on the \u003chttp://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing missing values for different data types\u003e. \r\n \r\n\r\nExample: \r\n\r\n  \r\n\r\n  Input:\r\n  \u003e\u003e x = {'I', '', '', 'MATLAB'}\r\n  x =\r\n    1×4 cell array\r\n      'I'    ''    ''    'MATLAB'\r\n\r\n  Output:\r\n  \u003e\u003e y = string('I'); y(4) = 'MATLAB'\r\n  y = \r\n    1×4 string array\r\n      \"I\"    \u003cmissing\u003e    \u003cmissing\u003e    \"MATLAB\"\r\n\r\nRelated Problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values   String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003e \r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values   String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003e \r\n* String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values   String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003e\r\n","description_html":"\u003cp\u003e\u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eString array\u003c/a\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data.\u003c/p\u003e\u003cp\u003eThe \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\"\u003ePart 1\u003c/a\u003e assuming no missing values in the input cell array is a good starting point. In this problem, the missing values for cell array of character vectors, denoted \u003cb\u003e{''}\u003c/b\u003e (i.e., cell of empty character), need to be converted to the missing values for string arrays, denoted \u003cb\u003e\u0026lt; missing \u0026gt;\u003c/b\u003e.\u003c/p\u003e\u003cp\u003eRefer to the R2016b documentation for more information on the \u003ca href = \"http://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing\"\u003emissing values for different data types\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\n\u0026gt;\u0026gt; x = {'I', '', '', 'MATLAB'}\r\nx =\r\n  1×4 cell array\r\n    'I'    ''    ''    'MATLAB'\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\n\u0026gt;\u0026gt; y = string('I'); y(4) = 'MATLAB'\r\ny = \r\n  1×4 string array\r\n    \"I\"    \u0026lt;missing\u0026gt;    \u0026lt;missing\u0026gt;    \"MATLAB\"\r\n\u003c/pre\u003e\u003cp\u003eRelated Problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\"\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\"\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\"\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = cell2str(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = {'I','love','MATLAB'};\r\ny_correct = string({'I','love','MATLAB'});\r\nassert(isequal(cell2str(x),y_correct))\r\n\r\n%%\r\nx = {'I', '', '', 'MATLAB'};\r\ny_correct = string('I'); y_correct(4) = 'MATLAB';\r\nassert(isequaln(cell2str(x),y_correct))\r\n\r\n%%\r\nx = {'I',   '',      'MATLAB'\r\n     '',    'love',  'MATLAB'\r\n     'I',   'love',  ''      };\r\ny_correct = [string('I'),  string(NaN),     string('MATLAB')\r\n             string(NaN),  string('love'),  string('MATLAB')\r\n             string('I'),  string('love'),  string(NaN)     ];\r\nassert(isequaln(cell2str(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":123,"test_suite_updated_at":"2016-11-23T06:30:05.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-21T04:09:03.000Z","updated_at":"2026-03-10T20:06:28.000Z","published_at":"2016-11-22T21:16: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:hyperlink w:docLocation=\\\"http://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data.\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\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://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePart 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e assuming no missing values in the input cell array is a good starting point. In this problem, the missing values for cell array of character vectors, denoted\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e{''}\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (i.e., cell of empty character), need to be converted to the missing values for string arrays, denoted\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u0026lt; missing \u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRefer to the R2016b documentation for more information on the\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://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emissing values for different data types\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\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:\\n\u003e\u003e x = {'I', '', '', 'MATLAB'}\\nx =\\n  1×4 cell array\\n    'I'    ''    ''    'MATLAB'\\n\\nOutput:\\n\u003e\u003e y = string('I'); y(4) = 'MATLAB'\\ny = \\n  1×4 string array\\n    \\\"I\\\"    \u003cmissing\u003e    \u003cmissing\u003e    \\\"MATLAB\\\"]]\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\u003eRelated Problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43667,"title":"Use a timetable to analyze a train timetable (Part 4)","description":"You are analyzing a train timetable (you have some time to kill since you just missed your train!) What is the average daily trip duration?\r\nExample:\r\nDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n     DepTime          Destination          ArrTime       \r\n____________________    ___________    ____________________\r\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\nThe result should be a duration variable:\r\nDur = [duration(3,9,05);duration(2,55,15);duration(3,0,24)]\r\nDur = \r\n3×1 duration array\r\n 03:09:50\r\n 02:55:15\r\n 03:00:24\r\nFeature Tip: R2016b introduces timetables with related functions which may be helpful. To learn more see MATLAB Timetables.\r\nRelated Problems:\r\nUse a timetable to analyze a train timetable (Part 1)\r\nUse a timetable to analyze a train timetable (Part 2)\r\nUse a timetable to analyze a train timetable (Part 3)\r\nUse a timetable to analyze a train timetable (Part 4)\r\nUse a timetable to analyze a train timetable (Part 5)","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eYou are analyzing a train timetable (you have some time to kill since you just missed your train!) What is the average daily trip duration?\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-bottom: 10px; margin-left: 3px; margin-right: 3px; margin-top: 10px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eDestination = categorical({\u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e'BOS'\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e;\u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e'NYC'\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e;\u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e'BOS'\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e});\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003ett = timetable(DepTime,Destination,ArrTime)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003ett = \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e     DepTime          \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003eDestination\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e          \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003eArrTime\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e       \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"border-block-end: 0px none rgb(255, 0, 0); border-block-start: 0px none rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end: 0px none rgb(255, 0, 0); border-inline-start: 0px none rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-right: 0px; outline-color: rgb(255, 0, 0); text-decoration-color: rgb(255, 0, 0); \"\u003e____________________\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(255, 0, 0); border-block-start: 0px none rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end: 0px none rgb(255, 0, 0); border-inline-start: 0px none rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-right: 0px; outline-color: rgb(255, 0, 0); text-decoration-color: rgb(255, 0, 0); \"\u003e___________\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(255, 0, 0); border-block-start: 0px none rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end: 0px none rgb(255, 0, 0); border-inline-start: 0px none rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-right: 0px; outline-color: rgb(255, 0, 0); text-decoration-color: rgb(255, 0, 0); \"\u003e____________________\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e01-Nov-2016 06:22:00    BOS            \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e01-Nov-2016 09:17:00\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e01-Nov-2016 08:51:00    NYC            \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e01-Nov-2016 10:32:00\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e01-Nov-2016 09:05:00    BOS            \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e01-Nov-2016 12:09:00\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 10px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eThe result should be a duration variable:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-bottom: 10px; margin-left: 3px; margin-right: 3px; margin-top: 10px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eDur = [duration(3,9,05);duration(2,55,15);duration(3,0,24)]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eDur = \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e3\u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(255, 0, 0); border-block-start: 0px none rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end: 0px none rgb(255, 0, 0); border-inline-start: 0px none rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-right: 0px; outline-color: rgb(255, 0, 0); text-decoration-color: rgb(255, 0, 0); \"\u003e×\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e1 duration \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003earray\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e 03:09:50\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e 02:55:15\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e 03:00:24\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 10px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eFeature Tip:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eR2016b\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e introduces timetables with related functions which may be helpful. To learn more see\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMATLAB Timetables\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eRelated Problems:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function ttDaily = myFun(tt)\r\n  ttDaily = tt;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nDur = [duration(3,9,50);duration(2,55,15);duration(3,0,24)];\r\nttDur = myFun(tt);\r\nif isrow(ttDur); ttDur = ttDur'; end\r\nassert(all(abs(ttDur - Dur) \u003c= 0.0001))","published":true,"deleted":false,"likes_count":0,"comments_count":7,"created_by":102743,"edited_by":26769,"edited_at":"2022-04-22T12:40:24.000Z","deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":"2022-04-22T12:40:24.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T21:12:23.000Z","updated_at":"2026-03-10T17:24:43.000Z","published_at":"2016-11-18T21:12: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\u003eYou are analyzing a train timetable (you have some time to kill since you just missed your train!) What is the average daily trip duration?\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: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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\nDestination = categorical({'BOS';'NYC';'BOS'});\\ntt = timetable(DepTime,Destination,ArrTime)\\ntt = \\n     DepTime          Destination          ArrTime       \\n____________________    ___________    ____________________\\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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\u003eThe result should be a duration variable:\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[Dur = [duration(3,9,05);duration(2,55,15);duration(3,0,24)]\\nDur = \\n3×1 duration array\\n 03:09:50\\n 02:55:15\\n 03:00:24]]\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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\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\u003eRelated Problems:\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:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":43668,"title":"Use a timetable to analyze a train timetable (Part 5)","description":"You are analyzing a train timetable (you have some time to kill since you just missed your train!) How many trains depart each day of the week? (submit the results as a table with the days of the week and number of trains)\r\n\r\n\r\n*Example* \r\n\r\n  DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n         DepTime          Destination          ArrTime       \r\n____________________    ___________    ____________________\r\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\n\r\nThe result should be given as a table:\r\n\r\n  DayOfWk = {'Thu';'Tue';'Wed'};\r\n  GroupCount = [5;6;4];\r\n  numTrains = table(DayOfWk,GroupCount)\r\nnumTrains = \r\n    DayOfWk    GroupCount\r\n    _______    __________\r\n    'Thu'      5         \r\n    'Tue'      6         \r\n    'Wed'      4   \r\n\r\n*Feature Tip:* \u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces timetables with related functions which may be helpful. To learn more see \u003chttp://www.mathworks.com/help/matlab/timetables.html MATLAB Timetables\u003e.\r\n\r\n*Related Problems:* \r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1 Use a timetable to analyze a train timetable (Part 1)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2 Use a timetable to analyze a train timetable (Part 2)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43666-use-a-timetable-to-analyze-a-train-timetable-part-3 Use a timetable to analyze a train timetable (Part 3)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4 Use a timetable to analyze a train timetable (Part 4)\u003e\r\n\r\nUse a timetable to analyze a train timetable (Part 5)","description_html":"\u003cp\u003eYou are analyzing a train timetable (you have some time to kill since you just missed your train!) How many trains depart each day of the week? (submit the results as a table with the days of the week and number of trains)\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n       DepTime          Destination          ArrTime       \r\n____________________    ___________    ____________________\r\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\n\u003c/pre\u003e\u003cp\u003eThe result should be given as a table:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eDayOfWk = {'Thu';'Tue';'Wed'};\r\nGroupCount = [5;6;4];\r\nnumTrains = table(DayOfWk,GroupCount)\r\nnumTrains = \r\n  DayOfWk    GroupCount\r\n  _______    __________\r\n  'Thu'      5         \r\n  'Tue'      6         \r\n  'Wed'      4   \r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e \u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces timetables with related functions which may be helpful. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/timetables.html\"\u003eMATLAB Timetables\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2\"\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43666-use-a-timetable-to-analyze-a-train-timetable-part-3\"\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/p\u003e","function_template":"function numTrains = myFun(tt)\r\n  y = x;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\n% create resulting table\r\nDayOfWk = {'Thu';'Tue';'Wed'}; \r\nGroupCount = [5;6;4];\r\ntestTrains = table(DayOfWk,GroupCount);\r\nnumTrains = myFun(tt);\r\n% allow for different text types \r\ntestTrains2 = testTrains;\r\ntestTrains2.DayOfWk = string(testTrains2.DayOfWk);\r\ntestTrains3 = testTrains;\r\ntestTrains3.DayOfWk = categorical(testTrains3.DayOfWk);\r\ntestTrains4 = testTrains;\r\ntestTrains4.DayOfWk = char(testTrains4.DayOfWk);\r\nassert(isequal(testTrains,numTrains) | ...\r\n    isequal(testTrains2,numTrains) | ...\r\n    isequal(testTrains3,numTrains) | ...\r\n    isequal(testTrains4,numTrains))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":102743,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":"2016-11-19T16:42:02.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T21:20:45.000Z","updated_at":"2026-03-10T19:00:14.000Z","published_at":"2016-11-18T21:20:45.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eYou are analyzing a train timetable (you have some time to kill since you just missed your train!) How many trains depart each day of the week? (submit the results as a table with the days of the week and number of trains)\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\nDestination = categorical({'BOS';'NYC';'BOS'});\\ntt = timetable(DepTime,Destination,ArrTime)\\ntt = \\n       DepTime          Destination          ArrTime       \\n____________________    ___________    ____________________\\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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 result should be given as a table:\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[DayOfWk = {'Thu';'Tue';'Wed'};\\nGroupCount = [5;6;4];\\nnumTrains = table(DayOfWk,GroupCount)\\nnumTrains = \\n  DayOfWk    GroupCount\\n  _______    __________\\n  'Thu'      5         \\n  'Tue'      6         \\n  'Wed'      4]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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://www.mathworks.com/help/matlab/timetables.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43666-use-a-timetable-to-analyze-a-train-timetable-part-3\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\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":43658,"title":"When Was That Goal Scored?","description":"We want to find out when the goals were scored in a particular soccer game. For each game, we are given a \"Goal Event Data\" XML string from a soccer database. Your job is to pick out the \"Elapsed Time\" number for each goal. Return the numbers for each goal as a column vector of double precision numbers.\r\n\r\nThis translates to finding the number between the \"\u003celapsed\u003e\" tags.\r\n\r\n*Example*\r\n\r\nGiven this input\r\n\r\n ged = '\u003cgoal\u003e\u003cvalue\u003e\u003celapsed\u003e22\u003c/elapsed\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003c/value\u003e\u003c/goal\u003e'\r\n\r\nyou should return the number 22.\r\n\r\nNote that you must return the number 22 and not the string.\r\n\r\n*Feature Tip* \r\n\r\n\u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003chttps://www.mathworks.com/help/matlab/characters-and-strings.html MATLAB Characters and Strings\u003e.","description_html":"\u003cp\u003eWe want to find out when the goals were scored in a particular soccer game. For each game, we are given a \"Goal Event Data\" XML string from a soccer database. Your job is to pick out the \"Elapsed Time\" number for each goal. Return the numbers for each goal as a column vector of double precision numbers.\u003c/p\u003e\u003cp\u003eThis translates to finding the number between the \"\u0026lt;elapsed\u0026gt;\" tags.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eGiven this input\u003c/p\u003e\u003cpre\u003e ged = '\u0026lt;goal\u0026gt;\u0026lt;value\u0026gt;\u0026lt;elapsed\u0026gt;22\u0026lt;/elapsed\u0026gt;\u0026lt;subtype\u0026gt;header\u0026lt;/subtype\u0026gt;\u0026lt;/value\u0026gt;\u0026lt;/goal\u0026gt;'\u003c/pre\u003e\u003cp\u003eyou should return the number 22.\u003c/p\u003e\u003cp\u003eNote that you must return the number 22 and not the string.\u003c/p\u003e\u003cp\u003e\u003cb\u003eFeature Tip\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003ca href = \"https://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eMATLAB Characters and Strings\u003c/a\u003e.\u003c/p\u003e","function_template":"function elapsed = getElapsedTime(ged)\r\n    elapsed = 0;\r\nend\r\n","test_suite":"%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003celapsed\u003e47\u003c/elapsed\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [47];\r\nassert(isequal(elapsed,elapsed_correct))\r\n\r\n%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e406\u003c/event_incident_typefk\u003e\u003celapsed\u003e22\u003c/elapsed\u003e\u003cplayer2\u003e38807\u003c/player2\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003cplayer1\u003e37799\u003c/player1\u003e\u003csortorder\u003e5\u003c/sortorder\u003e\u003cteam\u003e10261\u003c/team\u003e\u003cid\u003e378998\u003c/id\u003e\u003cn\u003e295\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e393\u003c/event_incident_typefk\u003e\u003celapsed\u003e24\u003c/elapsed\u003e\u003cplayer2\u003e24154\u003c/player2\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cplayer1\u003e24148\u003c/player1\u003e\u003csortorder\u003e4\u003c/sortorder\u003e\u003cteam\u003e10260\u003c/team\u003e\u003cid\u003e379019\u003c/id\u003e\u003cn\u003e298\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [22;24];\r\nassert(isequal(elapsed,elapsed_correct))\r\n\r\n%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e406\u003c/event_incident_typefk\u003e\u003celapsed\u003e73\u003c/elapsed\u003e\u003cplayer2\u003e25668\u003c/player2\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003cplayer1\u003e38755\u003c/player1\u003e\u003csortorder\u003e2\u003c/sortorder\u003e\u003cteam\u003e10194\u003c/team\u003e\u003cid\u003e465096\u003c/id\u003e\u003cn\u003e321\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [73];\r\nassert(isequal(elapsed,elapsed_correct))\r\n\r\n%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e393\u003c/event_incident_typefk\u003e\u003celapsed\u003e3\u003c/elapsed\u003e\u003cplayer2\u003e24635\u003c/player2\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cplayer1\u003e37139\u003c/player1\u003e\u003csortorder\u003e3\u003c/sortorder\u003e\u003cteam\u003e8650\u003c/team\u003e\u003cid\u003e468555\u003c/id\u003e\u003cn\u003e239\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003eo\u003c/comment\u003e\u003cstats\u003e\u003cowngoals\u003e1\u003c/owngoals\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e115\u003c/event_incident_typefk\u003e\u003celapsed\u003e69\u003c/elapsed\u003e\u003cplayer1\u003e30617\u003c/player1\u003e\u003csortorder\u003e3\u003c/sortorder\u003e\u003cteam\u003e8650\u003c/team\u003e\u003cid\u003e468934\u003c/id\u003e\u003cn\u003e304\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003eo\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed_plus\u003e1\u003c/elapsed_plus\u003e\u003cevent_incident_typefk\u003e393\u003c/event_incident_typefk\u003e\u003celapsed\u003e90\u003c/elapsed\u003e\u003cplayer2\u003e23949\u003c/player2\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cplayer1\u003e40755\u003c/player1\u003e\u003csortorder\u003e2\u003c/sortorder\u003e\u003cteam\u003e8586\u003c/team\u003e\u003cid\u003e469035\u003c/id\u003e\u003cn\u003e328\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [3; 69; 90];\r\nassert(isequal(elapsed,elapsed_correct))\r\n\r\n%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e11\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8472\u003c/team\u003e\u003cid\u003e507018\u003c/id\u003e\u003cn\u003e250\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e18\u003c/elapsed\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003cteam\u003e8559\u003c/team\u003e\u003cid\u003e507106\u003c/id\u003e\u003cn\u003e255\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e21\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8559\u003c/team\u003e\u003cid\u003e507142\u003c/id\u003e\u003cn\u003e259\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003edg\u003c/comment\u003e\u003celapsed\u003e30\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8472\u003c/team\u003e\u003cid\u003e507259\u003c/id\u003e\u003cn\u003e148\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003edg\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e39\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8559\u003c/team\u003e\u003cid\u003e507390\u003c/id\u003e\u003cn\u003e278\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e55\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8559\u003c/team\u003e\u003cid\u003e507734\u003c/id\u003e\u003cn\u003e295\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [11; 18; 21; 30; 39; 55];\r\nassert(isequal(elapsed,elapsed_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":124,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-17T17:32:24.000Z","updated_at":"2026-03-24T21:01:26.000Z","published_at":"2016-11-17T17:46:42.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\u003eWe want to find out when the goals were scored in a particular soccer game. For each game, we are given a \\\"Goal Event Data\\\" XML string from a soccer database. Your job is to pick out the \\\"Elapsed Time\\\" number for each goal. Return the numbers for each goal as a column vector of double precision numbers.\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 translates to finding the number between the \\\"\u0026lt;elapsed\u0026gt;\\\" tags.\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\u003eGiven this input\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[ ged = '\u003cgoal\u003e\u003cvalue\u003e\u003celapsed\u003e22\u003c/elapsed\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003c/value\u003e\u003c/goal\u003e']]\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\u003eyou should return the number 22.\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\u003eNote that you must return the number 22 and not the 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces string arrays and text manipulation functions which can help. To learn more see\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/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Characters and Strings\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":43670,"title":"Words Count: A String Array Approach","description":"Given an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\n), arrange the unique words alphabetically in a \u003chttps://www.mathworks.com/help/matlab/characters-and-strings.html string array\u003e and calculate the histogram count of every unique word.\r\n\r\nAssumptions:\r\n\r\n# Case is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output string array either the uppercase or lowercase.\r\n# Punctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\r\n\r\nFor example, given the input txt as a character vector,\r\n\r\n  txt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\n\r\nthe outputs should be\r\n\r\n  words = string({'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\r\n                  'on';'problems';'trivial'});\r\n  count = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n\r\nHint: The R2016b documentation provides a good \u003chttp://www.mathworks.com/help/matlab/matlab_prog/analyze-text-data-with-string-arrays.html example\u003e of text data analysis via the string array approach. However, some steps illustrated in that example are unnecessary, and we can indeed accomplish the same task in a simpler way.\r\n\r\nRelated problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43671-words-count-a-cell-array-approach Words Count: A Cell Array Approach\u003e\r\n* Words Count: A String Array Approach","description_html":"\u003cp\u003eGiven an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\n), arrange the unique words alphabetically in a \u003ca href = \"https://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003estring array\u003c/a\u003e and calculate the histogram count of every unique word.\u003c/p\u003e\u003cp\u003eAssumptions:\u003c/p\u003e\u003col\u003e\u003cli\u003eCase is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output string array either the uppercase or lowercase.\u003c/li\u003e\u003cli\u003ePunctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eFor example, given the input txt as a character vector,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003etxt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\n\u003c/pre\u003e\u003cp\u003ethe outputs should be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ewords = string({'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\r\n                'on';'problems';'trivial'});\r\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n\u003c/pre\u003e\u003cp\u003eHint: The R2016b documentation provides a good \u003ca href = \"http://www.mathworks.com/help/matlab/matlab_prog/analyze-text-data-with-string-arrays.html\"\u003eexample\u003c/a\u003e of text data analysis via the string array approach. However, some steps illustrated in that example are unnecessary, and we can indeed accomplish the same task in a simpler way.\u003c/p\u003e\u003cp\u003eRelated problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43671-words-count-a-cell-array-approach\"\u003eWords Count: A Cell Array Approach\u003c/a\u003e\u003c/li\u003e\u003cli\u003eWords Count: A String Array Approach\u003c/li\u003e\u003c/ul\u003e","function_template":"function [words,count] = wordscount(txt)\r\n  words = txt;\r\n  count = 1;\r\nend","test_suite":"%%\r\ntxt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\nwords = string({'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';'on';'problems';'trivial'});\r\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))\r\n\r\n%%\r\ntxt = sprintf('\\n\\nI love MATLAB and Cody, but I don''t like trivial matlab problems on cody.\\n\\nUnfortunately, there are too many trivial problems on Cody.');\r\nwords = string({'and';'are';'but';'cody';'don''t';'I';'like';'love';'many';'matlab';'on';'problems';'there';'too';'trivial';'unfortunately'});\r\ncount = [1; 1; 1; 3; 1; 2; 1; 1; 1; 2; 2; 2; 1; 1; 2; 1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))\r\n\r\n%%\r\ntxt = ['What is Cody? ',newline,' Cody is a MATLAB Central game', newline ...\r\n       'that expands your knowledge of MATLAB.',newline,...\r\n       'With Cody, you can:',newline, ...\r\n       'Solve problems related to MATLAB code;',newline, ...\r\n       'Find problems, solutions, and players;  ',newline, ...\r\n       'Use search directives to find content; ',newline, ...\r\n       'Challenge the community by contributing problems;',newline, ...\r\n       ' Comment on any problem or solution;',newline,...\r\n       'Like a problem or a solution; ',newline, ...\r\n       'Earn badges;',newline,newline, ...\r\n       'Play now!'];\r\nwords = string({'a';'and';'any';'badges';'by';'can';'central';'challenge';'code';'cody';'comment';...\r\n                'community';'content';'contributing';'directives';'earn';'expands';'find';'game';...\r\n                'is';'knowledge';'like';'matlab';'now';'of';'on';'or';'play';'players';'problem';...\r\n                'problems';'related';'search';'solution';'solutions';'solve';'that';'the';'to';...\r\n                'use';'what';'with';'you';'your'});\r\ncount = [3;1;1;1;1;1;1;1;1;3;1;1;1;1;1;1;1;2;1;2;1;1;3;1;1;1;2;1;1;2;3;1;1;2;1;1;1;1;2;1;1;1;1;1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))","published":true,"deleted":false,"likes_count":12,"comments_count":2,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":82,"test_suite_updated_at":"2016-12-02T05:47:45.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-20T06:50:46.000Z","updated_at":"2026-03-09T20:37:06.000Z","published_at":"2016-11-20T09:01:29.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 an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\\\n), arrange the unique words alphabetically in a\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/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estring array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and calculate the histogram count of every unique word.\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\u003eAssumptions:\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCase is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output string array either the uppercase or lowercase.\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePunctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\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, given the input txt as a character vector,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[txt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';]]\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 outputs should be\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[words = string({'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\\n                'on';'problems';'trivial'});\\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: The R2016b documentation provides a good\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://www.mathworks.com/help/matlab/matlab_prog/analyze-text-data-with-string-arrays.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eexample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e of text data analysis via the string array approach. However, some steps illustrated in that example are unnecessary, and we can indeed accomplish the same task in a simpler way.\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\u003eRelated problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43671-words-count-a-cell-array-approach\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWords Count: A Cell Array Approach\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWords Count: A String Array Approach\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":43671,"title":"Words Count: A Cell Array Approach","description":"Given an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\n), arrange the unique words alphabetically in a cell array of character vectors (formerly called \u003chttps://www.mathworks.com/help/matlab/matlab_prog/cell-arrays-of-strings.html cell array of strings\u003e) and calculate the histogram count of every unique word.\r\n\r\nAssumptions:\r\n\r\n# Case is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output cell array either the uppercase or lowercase.\r\n# Punctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\r\n\r\nFor example, given the input txt as a character vector,\r\n\r\n  txt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\n\r\nthe outputs should be\r\n\r\n  words = {'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\r\n           'on';'problems';'trivial'};\r\n  count = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n\r\nHint: The cell array of strings approach is the dual of the string array approach, i.e., things that can be done via the \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach string arrays approach\u003e can also be done using the cell array approach. \r\n\r\nRelated problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach Words Count: A String Array Approach\u003e\r\n* Words Count: A Cell Array Approach\r\n","description_html":"\u003cp\u003eGiven an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\n), arrange the unique words alphabetically in a cell array of character vectors (formerly called \u003ca href = \"https://www.mathworks.com/help/matlab/matlab_prog/cell-arrays-of-strings.html\"\u003ecell array of strings\u003c/a\u003e) and calculate the histogram count of every unique word.\u003c/p\u003e\u003cp\u003eAssumptions:\u003c/p\u003e\u003col\u003e\u003cli\u003eCase is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output cell array either the uppercase or lowercase.\u003c/li\u003e\u003cli\u003ePunctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eFor example, given the input txt as a character vector,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003etxt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\n\u003c/pre\u003e\u003cp\u003ethe outputs should be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ewords = {'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\r\n         'on';'problems';'trivial'};\r\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n\u003c/pre\u003e\u003cp\u003eHint: The cell array of strings approach is the dual of the string array approach, i.e., things that can be done via the \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach\"\u003estring arrays approach\u003c/a\u003e can also be done using the cell array approach.\u003c/p\u003e\u003cp\u003eRelated problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach\"\u003eWords Count: A String Array Approach\u003c/a\u003e\u003c/li\u003e\u003cli\u003eWords Count: A Cell Array Approach\u003c/li\u003e\u003c/ul\u003e","function_template":"function [words,count] = wordscount(txt)\r\n  words = txt;\r\n  count = 1;\r\nend","test_suite":"%%\r\ntxt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\nwords = {'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';'on';'problems';'trivial'};\r\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))\r\n\r\n%%\r\ntxt = sprintf('I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.\\n\\nUnfortunately, there are too many trivial problems on Cody.');\r\nwords = {'and';'are';'but';'cody';'don''t';'I';'like';'love';'many';'matlab';'on';'problems';'there';'too';'trivial';'unfortunately'};\r\ncount = [1; 1; 1; 3; 1; 2; 1; 1; 1; 2; 2; 2; 1; 1; 2; 1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))\r\n\r\n%%\r\ntxt = ['What is Cody? ',newline,' Cody is a MATLAB Central game', newline ...\r\n       'that expands your knowledge of MATLAB.',newline,...\r\n       'With Cody, you can:',newline, ...\r\n       'Solve problems related to MATLAB code;',newline, ...\r\n       'Find problems, solutions, and players;  ',newline, ...\r\n       'Use search directives to find content; ',newline, ...\r\n       'Challenge the community by contributing problems;',newline, ...\r\n       ' Comment on any problem or solution;',newline,...\r\n       'Like a problem or a solution; ',newline, ...\r\n       'Earn badges;',newline,newline, ...\r\n       'Play now!'];\r\nwords = {'a';'and';'any';'badges';'by';'can';'central';'challenge';'code';'cody';'comment';...\r\n         'community';'content';'contributing';'directives';'earn';'expands';'find';'game';...\r\n         'is';'knowledge';'like';'matlab';'now';'of';'on';'or';'play';'players';'problem';...\r\n         'problems';'related';'search';'solution';'solutions';'solve';'that';'the';'to';...\r\n         'use';'what';'with';'you';'your'};\r\ncount = [3;1;1;1;1;1;1;1;1;3;1;1;1;1;1;1;1;2;1;2;1;1;3;1;1;1;2;1;1;2;3;1;1;2;1;1;1;1;2;1;1;1;1;1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":68,"test_suite_updated_at":"2016-12-02T06:03:05.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-20T07:04:31.000Z","updated_at":"2026-03-09T20:25:19.000Z","published_at":"2016-11-20T09:01: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\u003eGiven an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\\\n), arrange the unique words alphabetically in a cell array of character vectors (formerly called\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/help/matlab/matlab_prog/cell-arrays-of-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecell array of strings\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e) and calculate the histogram count of every unique word.\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\u003eAssumptions:\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCase is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output cell array either the uppercase or lowercase.\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePunctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\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, given the input txt as a character vector,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[txt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';]]\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 outputs should be\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[words = {'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\\n         'on';'problems';'trivial'};\\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: The cell array of strings approach is the dual of the string array approach, i.e., things that can be done via the\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://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estring arrays approach\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e can also be done using the cell array approach.\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\u003eRelated problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWords Count: A String Array Approach\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWords Count: A Cell Array Approach\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":43009,"title":"Back to Basics - New Data Type in R2016b - convert a char to a string","description":"Convert an char array into a string.\r\n\r\n","description_html":"\u003cp\u003eConvert an char array into a string.\u003c/p\u003e","function_template":"function y = convert2string(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx ='abcdef';\r\ny_correct = string(x)\r\nassert((convert2string(x)==y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":4690,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":101,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-03T17:41:53.000Z","updated_at":"2026-02-09T16:08:02.000Z","published_at":"2016-10-03T17:41:53.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 an char array into a 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":43672,"title":"String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values","description":"\u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html String array\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\r\n\r\nTo begin with, let's assume that there are no missing type values in the input string array. \r\n\r\nExample: \r\n\r\n  Input:\r\n  \u003e\u003e x = string({'I','love','MATLAB'})\r\n  x = \r\n    1×3 string array\r\n      \"I\"    \"love\"    \"MATLAB\";\r\n\r\n  Output:\r\n  \u003e\u003e y = {'I','love','MATLAB'}\r\n  y =\r\n    1×3 cell array\r\n      'I'    'love'    'MATLAB';\r\n\r\nRelated Problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values   String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003e \r\n* String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values   String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003e\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values   String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003e","description_html":"\u003cp\u003e\u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eString array\u003c/a\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\u003c/p\u003e\u003cp\u003eTo begin with, let's assume that there are no missing type values in the input string array.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\n\u0026gt;\u0026gt; x = string({'I','love','MATLAB'})\r\nx = \r\n  1×3 string array\r\n    \"I\"    \"love\"    \"MATLAB\";\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\n\u0026gt;\u0026gt; y = {'I','love','MATLAB'}\r\ny =\r\n  1×3 cell array\r\n    'I'    'love'    'MATLAB';\r\n\u003c/pre\u003e\u003cp\u003eRelated Problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\"\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\"\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\"\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = str2cell(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = string({'I','love','MATLAB'});\r\ny_correct = {'I','love','MATLAB'};\r\nassert(isequal(str2cell(x),y_correct))\r\n\r\n%%\r\nx = string({'I','love','MATLAB';'I','love','Cody'});\r\ny_correct = {'I','love','MATLAB'\r\n             'I','love','Cody'};\r\nassert(isequal(str2cell(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":153,"test_suite_updated_at":"2016-11-23T06:40:34.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-21T01:00:23.000Z","updated_at":"2026-03-10T19:51:47.000Z","published_at":"2016-11-22T21:10: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:hyperlink w:docLocation=\\\"http://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo begin with, let's assume that there are no missing type values in the input string 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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Input:\\n\u003e\u003e x = string({'I','love','MATLAB'})\\nx = \\n  1×3 string array\\n    \\\"I\\\"    \\\"love\\\"    \\\"MATLAB\\\";\\n\\nOutput:\\n\u003e\u003e y = {'I','love','MATLAB'}\\ny =\\n  1×3 cell array\\n    'I'    'love'    'MATLAB';]]\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\u003eRelated Problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing 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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43662,"title":"Use R2016b Text Manipulations to Fix These Addresses (Part 3)","description":"\r\nWe have a series of addresses like the following which we'd like to reformat. Each of the addresses lacks a space and a comma between the street name (which always ends with a period) and the neighborhood/city name. Can you insert a space between these?\r\n\r\n*Example:*\r\n\r\n  Input:\r\n  adrIn = '950 Blue Hill Ave.Dorchester, MA 02124';\r\n\r\n  Output:\r\n  adrOut = '950 Blue Hill Ave., Dorchester, MA 02124';\r\n\r\n*Feature Tip:* \r\n\r\n\u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html  MATLAB Characters and Strings\u003e.\r\n\r\n*Background:* \r\n\r\nDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003chttps://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak here\u003e or import it into MATLAB with |webread|.\r\n\r\n  data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\r\n*Related Problems:*\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1 Use R2016b Text Manipulations to Fix These Addresses (Part 1)\u003e\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2 Use R2016b Text Manipulations to Fix These Addresses (Part 2)\u003e\r\n\r\nUse R2016b Text Manipulations to Fix These Addresses (Part 3)","description_html":"\u003cp\u003eWe have a series of addresses like the following which we'd like to reformat. Each of the addresses lacks a space and a comma between the street name (which always ends with a period) and the neighborhood/city name. Can you insert a space between these?\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\nadrIn = '950 Blue Hill Ave.Dorchester, MA 02124';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\nadrOut = '950 Blue Hill Ave., Dorchester, MA 02124';\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eMATLAB Characters and Strings\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eBackground:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003ca href = \"https://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\"\u003ehere\u003c/a\u003e or import it into MATLAB with \u003ctt\u003ewebread\u003c/tt\u003e.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003edata = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/p\u003e","function_template":"function adrOut = myFun(adrIn)\r\n  adrOut = adrIn;\r\nend","test_suite":"%%\r\nx = '950 Blue Hill Ave.Dorchester, MA 02124';\r\ny = string('950 Blue Hill Ave., Dorchester, MA 02124');\r\nassert (all(y == myFun(x)));\r\n\r\n%%\r\nx = '259 Allandale Rd.Jamaica Plain, MA 02467';\r\ny = string('259 Allandale Rd., Jamaica Plain, MA 02467');\r\nassert (all(y == myFun(x)));\r\n\r\n%%\r\nx = '850 Harrison Ave.Boston, MA 02118';\r\ny = string('850 Harrison Ave., Boston, MA 02118');\r\nassert (all(y == myFun(x)));\r\n\r\n%%\r\nx = '23-29 Tucker St.Dorchester, MA 02124';\r\ny = string('23-29 Tucker St., Dorchester, MA 02124');\r\nassert (all(y == myFun(x)));","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":28291,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":108,"test_suite_updated_at":"2016-11-17T22:09:00.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-17T21:50:07.000Z","updated_at":"2026-03-10T19:38:55.000Z","published_at":"2016-11-17T21:59: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\",\"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\u003eWe have a series of addresses like the following which we'd like to reformat. Each of the addresses lacks a space and a comma between the street name (which always ends with a period) and the neighborhood/city name. Can you insert a space between these?\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Input:\\nadrIn = '950 Blue Hill Ave.Dorchester, MA 02124';\\n\\nOutput:\\nadrOut = '950 Blue Hill Ave., Dorchester, MA 02124';]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces string arrays and text manipulation functions which can help. To learn more see\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://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Characters and Strings\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eBackground:\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\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data\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://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or import it into MATLAB with\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewebread\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\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":43660,"title":"Use R2016b Text Manipulations to Fix These Addresses (Part 1)","description":"We have a series of addresses like the following which we'd like to reformat. Can you remove the latitude and longitude from the addresses?\r\n\r\n*Example:*\r\n\r\n  Input:\r\n  adrIn = '959 Blue Hill Ave.Dorchester, MA 2124(42.29189440573543, -71.0887162019496)';\r\n\r\n  Output:\r\n  adrOut = '950 Blue Hill Ave.Dorchester, MA 2124';\r\n\r\n*Feature Tip:* \r\n\r\n\u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html  MATLAB Characters and Strings\u003e.\r\n\r\n*Background:* \r\n\r\nDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003chttps://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak here\u003e or import it into MATLAB with |webread|.\r\n\r\n  data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\r\n*Related Problems:*\r\n\r\nUse R2016b Text Manipulations to Fix These Addresses (Part 1)\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2 Use R2016b Text Manipulations to Fix These Addresses (Part 2)\u003e\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3 Use R2016b Text Manipulations to Fix These Addresses (Part 3)\u003e","description_html":"\u003cp\u003eWe have a series of addresses like the following which we'd like to reformat. Can you remove the latitude and longitude from the addresses?\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\nadrIn = '959 Blue Hill Ave.Dorchester, MA 2124(42.29189440573543, -71.0887162019496)';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\nadrOut = '950 Blue Hill Ave.Dorchester, MA 2124';\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eMATLAB Characters and Strings\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eBackground:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003ca href = \"https://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\"\u003ehere\u003c/a\u003e or import it into MATLAB with \u003ctt\u003ewebread\u003c/tt\u003e.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003edata = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/a\u003e\u003c/p\u003e","function_template":"function y = myFun(adrIn)\r\n  adrOut = adrIn;\r\nend","test_suite":"%%\r\nx = '950 Blue Hill Ave.Dorchester, MA 2124(42.29189440573543, -71.0887162019496)';\r\ny = string('950 Blue Hill Ave.Dorchester, MA 2124');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx= '259 Allandale Rd.Jamaica Plain, MA 2467(42.30236456682541, -71.14054916195282)';\r\ny = string('259 Allandale Rd.Jamaica Plain, MA 2467');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '850 Harrison Ave.Boston, MA 2118(42.33517814576012, -71.07473087474541)';\r\ny = string('850 Harrison Ave.Boston, MA 2118');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '23-29 Tucker St.Dorchester, MA 2124(42.30786999970087, -71.06340000010977)';\r\ny = string('23-29 Tucker St.Dorchester, MA 2124');\r\nassert (all(y  == myFun(x)));\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":28291,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":125,"test_suite_updated_at":"2016-11-17T22:08:04.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-17T21:37:14.000Z","updated_at":"2026-03-10T19:24:56.000Z","published_at":"2016-11-17T21:58: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\u003eWe have a series of addresses like the following which we'd like to reformat. Can you remove the latitude and longitude from the addresses?\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Input:\\nadrIn = '959 Blue Hill Ave.Dorchester, MA 2124(42.29189440573543, -71.0887162019496)';\\n\\nOutput:\\nadrOut = '950 Blue Hill Ave.Dorchester, MA 2124';]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces string arrays and text manipulation functions which can help. To learn more see\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://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Characters and Strings\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eBackground:\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\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data\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://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or import it into MATLAB with\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewebread\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\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\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43661-use-r2016b-text-manipulations-to-fix-these-addresses-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43661,"title":"Use R2016b Text Manipulations to Fix These Addresses (Part 2)","description":"\r\nWe have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Massachusetts (MA) and should have a leading '0' before the 2 in the zip code. Can you insert the leading '0'?\r\n\r\n*Example:*\r\n\r\n  Input:\r\n  adrIn = '950 Blue Hill Ave.Dorchester, MA 2124';\r\n\r\n  Output:\r\n  adrOut = '950 Blue Hill Ave.Dorchester, MA 02124';\r\n\r\n*Feature Tip:* \r\n\r\n\u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html  MATLAB Characters and Strings\u003e.\r\n\r\n*Background:* \r\n\r\nDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003chttps://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak here\u003e or import it into MATLAB with |webread|.\r\n\r\n  data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\r\n*Related Problems:*\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1 Use R2016b Text Manipulations to Fix These Addresses (Part 1)\u003e\r\n\r\nUse R2016b Text Manipulations to Fix These Addresses (Part 2)\r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3 Use R2016b Text Manipulations to Fix These Addresses (Part 3)\u003e","description_html":"\u003cp\u003eWe have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Massachusetts (MA) and should have a leading '0' before the 2 in the zip code. Can you insert the leading '0'?\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\nadrIn = '950 Blue Hill Ave.Dorchester, MA 2124';\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\nadrOut = '950 Blue Hill Ave.Dorchester, MA 02124';\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eMATLAB Characters and Strings\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eBackground:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data \u003ca href = \"https://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\"\u003ehere\u003c/a\u003e or import it into MATLAB with \u003ctt\u003ewebread\u003c/tt\u003e.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003edata = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3\"\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/a\u003e\u003c/p\u003e","function_template":"function adrOut = myFun(adrIn)\r\n  adrOut = adrIn;\r\nend","test_suite":"%%\r\nx = '950 Blue Hill Ave.Dorchester, MA 2124';\r\ny = string('950 Blue Hill Ave.Dorchester, MA 02124');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '259 Allandale Rd.Jamaica Plain, MA 2467';\r\ny = string('259 Allandale Rd.Jamaica Plain, MA 02467');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '850 Harrison Ave.Boston, MA 2118';\r\ny = string('850 Harrison Ave.Boston, MA 02118');\r\nassert (all(y  == myFun(x)));\r\n\r\n%%\r\nx = '23-29 Tucker St.Dorchester, MA 2124';\r\ny = string('23-29 Tucker St.Dorchester, MA 02124');\r\nassert (all(y  == myFun(x)));","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":28291,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":106,"test_suite_updated_at":"2016-11-17T22:08:29.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-17T21:44:56.000Z","updated_at":"2026-03-10T19:31:57.000Z","published_at":"2016-11-17T21:59:04.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Massachusetts (MA) and should have a leading '0' before the 2 in the zip code. Can you insert the leading '0'?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Input:\\nadrIn = '950 Blue Hill Ave.Dorchester, MA 2124';\\n\\nOutput:\\nadrOut = '950 Blue Hill Ave.Dorchester, MA 02124';]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces string arrays and text manipulation functions which can help. To learn more see\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://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Characters and Strings\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eBackground:\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\u003eDid you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data\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://data.cityofboston.gov/Health/Urban-Orchards/c7cz-29ak\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehere\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e or import it into MATLAB with\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ewebread\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43660-use-r2016b-text-manipulations-to-fix-these-addresses-part-1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/43662-use-r2016b-text-manipulations-to-fix-these-addresses-part-3\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse R2016b Text Manipulations to Fix These Addresses (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43663,"title":"Combine the first and last names","description":"MATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays of the first names and last names. Your job is to join the first names with the corresponding last names, and output a new string array. \r\n\r\nFor example, if the inputs are\r\n\r\n  firstnames = [\"Donald\"; \"Hillary\"];\r\n  lastnames = [\"Trump\"; \"Clinton\"];\r\n\r\nthe output should be:\r\n\r\n  names = [\"Donald Trump\"; \"Hillary Clinton\"];\r\n\r\n","description_html":"\u003cp\u003eMATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays of the first names and last names. Your job is to join the first names with the corresponding last names, and output a new string array.\u003c/p\u003e\u003cp\u003eFor example, if the inputs are\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003efirstnames = [\"Donald\"; \"Hillary\"];\r\nlastnames = [\"Trump\"; \"Clinton\"];\r\n\u003c/pre\u003e\u003cp\u003ethe output should be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003enames = [\"Donald Trump\"; \"Hillary Clinton\"];\r\n\u003c/pre\u003e","function_template":"function y = fullname(firstnames,lastnames)\r\n  y = [firstnames,lastnames];\r\nend","test_suite":"%%\r\nassessFunctionAbsence('regexp','FileName','fullname.m')\r\n\r\n%%\r\nfirstnames = string({'Donald';'Hillary'});\r\nlastnames = string({'Trump';'Clinton'});\r\ny_correct = string({'Donald Trump';'Hillary Clinton'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))\r\n\r\n%%\r\nfirstnames = string({'Bill','Hillary'});\r\nlastnames = string('Clinton');\r\ny_correct = string({'Bill Clinton','Hillary Clinton'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))\r\n\r\n%%\r\nfirstnames = string({'Donald';'Barron';'Eric'});\r\nlastnames = string('Trump');\r\ny_correct = string({'Donald Trump';'Barron Trump';'Eric Trump'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))\r\n\r\n%%\r\nfirstnames = string('Mike');\r\nlastnames = string({'Tyson','Pence','Trout'});\r\ny_correct = string({'Mike Tyson','Mike Pence','Mike Trout'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))\r\n\r\n%%\r\nfirstnames = string({'Donald','Hillary';'Mike','James'});\r\nlastnames = string({'Trump','Clinton';'Pence','Bond'});\r\ny_correct = string({'Donald Trump','Hillary Clinton';'Mike Pence','James Bond'});\r\nassert(isequal(fullname(firstnames,lastnames),y_correct))","published":true,"deleted":false,"likes_count":7,"comments_count":2,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":170,"test_suite_updated_at":"2017-09-18T00:54:07.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T09:31:11.000Z","updated_at":"2026-03-10T21:21:28.000Z","published_at":"2016-11-18T09:31:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays of the first names and last names. Your job is to join the first names with the corresponding last names, and output a new string 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\u003eFor example, if the inputs are\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[firstnames = [\\\"Donald\\\"; \\\"Hillary\\\"];\\nlastnames = [\\\"Trump\\\"; \\\"Clinton\\\"];]]\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 output should be:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[names = [\\\"Donald Trump\\\"; \\\"Hillary Clinton\\\"];]]\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":43673,"title":"String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array","description":"\u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html String array\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array of text data. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\r\n\r\nThe \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values  Part 2\u003e assuming no missing values in the input string array is a good starting point. In this problem, the missing values for string arrays, denoted *\u003c missing \u003e*, need to be converted to the missing values for cell arrays, denoted *{''}* (i.e., cell of empty character). \r\n\r\nRefer to the R2016b documentation for more information on the \u003chttp://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing missing values for different data types\u003e.\r\n \r\nExample: \r\n\r\n  Input:\r\n  \u003e\u003e x = string({'I','love'}); x(4) = 'MATLAB'\r\n  x = \r\n    1×4 string array\r\n      \"I\"    \"love\"    \u003cmissing\u003e    \"MATLAB\"\r\n  \r\n  Output:\r\n  \u003e\u003e y = {'I', 'love', '', 'MATLAB'}\r\n  y =\r\n    1×3 cell array\r\n      'I'    'love'    ''    'MATLAB'\r\n\r\nRelated Problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values   String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003e \r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values   String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003e \r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values   String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003e\r\n* String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array","description_html":"\u003cp\u003e\u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eString array\u003c/a\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array of text data. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\u003c/p\u003e\u003cp\u003eThe \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\"\u003ePart 2\u003c/a\u003e assuming no missing values in the input string array is a good starting point. In this problem, the missing values for string arrays, denoted \u003cb\u003e\u0026lt; missing \u0026gt;\u003c/b\u003e, need to be converted to the missing values for cell arrays, denoted \u003cb\u003e{''}\u003c/b\u003e (i.e., cell of empty character).\u003c/p\u003e\u003cp\u003eRefer to the R2016b documentation for more information on the \u003ca href = \"http://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing\"\u003emissing values for different data types\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\n\u0026gt;\u0026gt; x = string({'I','love'}); x(4) = 'MATLAB'\r\nx = \r\n  1×4 string array\r\n    \"I\"    \"love\"    \u0026lt;missing\u0026gt;    \"MATLAB\"\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\n\u0026gt;\u0026gt; y = {'I', 'love', '', 'MATLAB'}\r\ny =\r\n  1×3 cell array\r\n    'I'    'love'    ''    'MATLAB'\r\n\u003c/pre\u003e\u003cp\u003eRelated Problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\"\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\"\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\"\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/a\u003e\u003c/li\u003e\u003cli\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = str2cell(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = string({'I','love','MATLAB'});\r\ny_correct = {'I','love','MATLAB'};\r\nassert(isequal(str2cell(x),y_correct))\r\n\r\n%%\r\nx = string({'I','love'}); x(5) = 'MATLAB';\r\ny_correct = {'I','love','','','MATLAB'};\r\nassert(isequal(str2cell(x),y_correct))\r\n\r\n%%\r\nx = string([1 NaN 2]);\r\ny_correct = {'1','','2'};\r\nassert(isequal(str2cell(x),y_correct))\r\n\r\n%%\r\nx = strings(3);\r\nx(1) = 'first'; \r\nx(end) = 'last';\r\ny_correct = {'first',  '',     ''\r\n             '',       '',     ''\r\n             '',       '',     'last'};\r\nassert(isequal(str2cell(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":119,"test_suite_updated_at":"2016-11-23T06:24:32.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-21T03:52:19.000Z","updated_at":"2026-03-10T20:16:49.000Z","published_at":"2016-11-22T21:16:18.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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:hyperlink w:docLocation=\\\"http://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a string array of text data. Your job is to convert the string array to a cell array of character vectors, which stores the same pieces of text data.\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\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://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePart 2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e assuming no missing values in the input string array is a good starting point. In this problem, the missing values for string arrays, denoted\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u0026lt; missing \u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, need to be converted to the missing values for cell arrays, denoted\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e{''}\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (i.e., cell of empty character).\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\u003eRefer to the R2016b documentation for more information on the\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://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emissing values for different data types\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\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:\\n\u003e\u003e x = string({'I','love'}); x(4) = 'MATLAB'\\nx = \\n  1×4 string array\\n    \\\"I\\\"    \\\"love\\\"    \u003cmissing\u003e    \\\"MATLAB\\\"\\n\\nOutput:\\n\u003e\u003e y = {'I', 'love', '', 'MATLAB'}\\ny =\\n  1×3 cell array\\n    'I'    'love'    ''    'MATLAB']]\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\u003eRelated Problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\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":43677,"title":"String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values","description":"\u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html String array\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data. \r\n\r\nTo begin with, let's assume that there are no missing type values in the input cell array. \r\n\r\n\r\nExample: \r\n \r\n\r\n  Input:\r\n  \u003e\u003e x = {'I','Love','MATLAB'}\r\n  x =\r\n    1×3 cell array\r\n      'I'    'Love'    'MATLAB'\r\n\r\n  Output:\r\n  \u003e\u003e y = strings(size(x));\r\n  \u003e\u003e [y{:}] = x{:}\r\n  y = \r\n    1×3 string array\r\n      \"I\"    \"Love\"    \"MATLAB\"\r\n\r\nNote that the example shown above is not the best way to solve this problem. Try other approaches in order to achieve a leading score. \r\n\r\nRelated Problems in this series:\r\n\r\n* String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values   String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003e \r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values   String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003e\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values   String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003e\r\n","description_html":"\u003cp\u003e\u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eString array\u003c/a\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data.\u003c/p\u003e\u003cp\u003eTo begin with, let's assume that there are no missing type values in the input cell array.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\n\u0026gt;\u0026gt; x = {'I','Love','MATLAB'}\r\nx =\r\n  1×3 cell array\r\n    'I'    'Love'    'MATLAB'\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\n\u0026gt;\u0026gt; y = strings(size(x));\r\n\u0026gt;\u0026gt; [y{:}] = x{:}\r\ny = \r\n  1×3 string array\r\n    \"I\"    \"Love\"    \"MATLAB\"\r\n\u003c/pre\u003e\u003cp\u003eNote that the example shown above is not the best way to solve this problem. Try other approaches in order to achieve a leading score.\u003c/p\u003e\u003cp\u003eRelated Problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\"\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\"\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\"\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = cell2str(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = {'I','love','MATLAB'};\r\ny_correct = strings(size(x));\r\n[y_correct{:}] = x{:};\r\nassert(isequal(cell2str(x),y_correct))\r\n\r\n%%\r\nx = {'I',   'love',  'MATLAB'\r\n     'I',   'love',  'Cody'};\r\ny_correct = strings(size(x));\r\n[y_correct{:}] = x{:};\r\nassert(isequal(cell2str(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":1,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1969,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-22T21:03:53.000Z","updated_at":"2026-04-01T18:24:18.000Z","published_at":"2016-11-22T21:05: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:hyperlink w:docLocation=\\\"http://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo begin with, let's assume that there are no missing type values in the input 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\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:\\n\u003e\u003e x = {'I','Love','MATLAB'}\\nx =\\n  1×3 cell array\\n    'I'    'Love'    'MATLAB'\\n\\nOutput:\\n\u003e\u003e y = strings(size(x));\\n\u003e\u003e [y{:}] = x{:}\\ny = \\n  1×3 string array\\n    \\\"I\\\"    \\\"Love\\\"    \\\"MATLAB\\\"]]\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\u003eNote that the example shown above is not the best way to solve this problem. Try other approaches in order to achieve a leading score.\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\u003eRelated Problems in this series:\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\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing 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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43674-string-array-basics-part-3-convert-cell-array-to-string-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43666,"title":"Use a timetable to analyze a train timetable (Part 3)","description":"Oh no, you missed your train to Boston (again?)! How many times can you miss that train today? (In other words, how many Boston trains depart on November 1, 2016?)\r\n\r\n*Example* \r\n\r\n  DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\n ArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\n Destination = categorical({'BOS';'NYC';'BOS'});\r\n tt = timetable(DepTime,Destination,ArrTime)\r\n tt = \r\n         DepTime          Destination          ArrTime       \r\n  ____________________    ___________    ____________________\r\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\n\r\n*Feature Tip:* \u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces timetables with related functions which may be helpful. To learn more see \u003chttp://www.mathworks.com/help/matlab/timetables.html MATLAB Timetables\u003e.\r\n\r\n*Related Problems:* \r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1 Use a timetable to analyze a train timetable (Part 1)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2 Use a timetable to analyze a train timetable (Part 2)\u003e\r\n\r\nUse a timetable to analyze a train timetable (Part 3)\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4 Use a timetable to analyze a train timetable (Part 4)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43668-use-a-timetable-to-analyze-a-train-timetable-part-5 Use a timetable to analyze a train timetable (Part 5)\u003e","description_html":"\u003cp\u003eOh no, you missed your train to Boston (again?)! How many times can you miss that train today? (In other words, how many Boston trains depart on November 1, 2016?)\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n       DepTime          Destination          ArrTime       \r\n____________________    ___________    ____________________\r\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e \u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces timetables with related functions which may be helpful. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/timetables.html\"\u003eMATLAB Timetables\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2\"\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43668-use-a-timetable-to-analyze-a-train-timetable-part-5\"\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/a\u003e\u003c/p\u003e","function_template":"function y = myFun(tt)\r\n  y = tt;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\ny = 5;\r\nassert(isequal(myFun(tt),y))\r\n%%\r\nDepTime = datetime(2016,11,[2;1;1;3],[4;10;7;1],[12;53;32;42],0);\r\nArrTime = DepTime + hours(3);\r\nDestination = categorical({'DC';'BOS';'BOS';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\ny = 2;\r\nassert(isequal(myFun(tt),y))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":102743,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":72,"test_suite_updated_at":"2016-11-19T03:02:31.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T20:44:02.000Z","updated_at":"2026-03-10T03:15:48.000Z","published_at":"2016-11-18T20:44:02.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\u003eOh no, you missed your train to Boston (again?)! How many times can you miss that train today? (In other words, how many Boston trains depart on November 1, 2016?)\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\nDestination = categorical({'BOS';'NYC';'BOS'});\\ntt = timetable(DepTime,Destination,ArrTime)\\ntt = \\n       DepTime          Destination          ArrTime       \\n____________________    ___________    ____________________\\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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://www.mathworks.com/help/matlab/timetables.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43668-use-a-timetable-to-analyze-a-train-timetable-part-5\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43665,"title":"Use a timetable to analyze a train timetable (Part 2)","description":"Oh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. You can leave after 6:30 but no later than 9:00. (Today is November 1, 2016)\r\nExample:\r\n DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\n ArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\n Destination = categorical({'BOS';'NYC';'BOS'});\r\n tt = timetable(DepTime,Destination,ArrTime)\r\n tt = \r\n         DepTime          Destination          ArrTime       \r\n  ____________________    ___________    ____________________\r\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\nFeature Tip: R2016b introduces timetables with related functions which may be helpful. To learn more see MATLAB Timetables.\r\nRelated Problems:\r\nUse a timetable to analyze a train timetable (Part 1)\r\nUse a timetable to analyze a train timetable (Part 2)\r\nUse a timetable to analyze a train timetable (Part 3)\r\nUse a timetable to analyze a train timetable (Part 4)\r\nUse a timetable to analyze a train timetable (Part 5)","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: 518.333px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 259.167px; transform-origin: 407px 259.167px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. You can leave after 6:30 but no later than 9:00. (Today is November 1, 2016)\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: 31.5px 8px; transform-origin: 31.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 204.333px; 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 102.167px; transform-origin: 404px 102.167px; 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: 212px 8.5px; tab-size: 4; transform-origin: 212px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\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: 220px 8.5px; tab-size: 4; transform-origin: 220px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e ArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\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: 192px 8.5px; tab-size: 4; transform-origin: 192px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 112px 8.5px; transform-origin: 112px 8.5px; \"\u003e Destination = categorical({\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'BOS'\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\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'NYC'\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\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'BOS'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 12px 8.5px; transform-origin: 12px 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: 176px 8.5px; tab-size: 4; transform-origin: 176px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e tt = timetable(DepTime,Destination,ArrTime)\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: 24px 8.5px; tab-size: 4; transform-origin: 24px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e tt = \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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 104px 8.5px; transform-origin: 104px 8.5px; \"\u003e         DepTime          \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: 44px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 44px 8.5px; \"\u003eDestination\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003e          \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: 28px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 28px 8.5px; \"\u003eArrTime\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 28px 8.5px; transform-origin: 28px 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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 8px 8.5px; transform-origin: 8px 8.5px; \"\u003e  \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 80px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 80px 8.5px; \"\u003e____________________\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 44px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 44px 8.5px; \"\u003e___________\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 80px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 80px 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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 06:22:00    BOS            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 09:17:00\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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 08:51:00    NYC            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 10:32:00\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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 09:05:00    BOS            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 12:09:00\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; 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: 42px 8px; transform-origin: 42px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eFeature Tip:\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eR2016b\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 266px 8px; transform-origin: 266px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e introduces timetables with related functions which may be helpful. To learn more see\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMATLAB Timetables\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 64px 8px; transform-origin: 64px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRelated Problems:\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 161px 8px; transform-origin: 161px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 2)\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function nextTime = myFun(tt)\r\n  nextTime = tt;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,7,39,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n%%\r\nDepTime = datetime(2016,11,[2;1;1;3],[4;10;7;1],[12;53;32;42],0);\r\nArrTime = DepTime + hours(3);\r\nDestination = categorical({'DC';'BOS';'BOS';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,07,32,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n%%\r\nDepTime = datetime(2016,11,[2;1],[6;7],[15;30],0);\r\nArrTime = datetime(2016,11,[2;1],[9;10],[13;31],0);\r\nDestination = categorical([1;1],1,{'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,7,30,0);\r\nassert(isequal(myFun(tt),nextTime))","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":102743,"edited_by":223089,"edited_at":"2022-04-26T19:32:39.000Z","deleted_by":null,"deleted_at":null,"solvers_count":77,"test_suite_updated_at":"2022-04-26T19:32:39.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T20:35:41.000Z","updated_at":"2026-03-10T03:07:32.000Z","published_at":"2016-11-18T20:35:41.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\u003eOh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. You can leave after 6:30 but no later than 9:00. (Today is November 1, 2016)\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: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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\n ArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\n Destination = categorical({'BOS';'NYC';'BOS'});\\n tt = timetable(DepTime,Destination,ArrTime)\\n tt = \\n         DepTime          Destination          ArrTime       \\n  ____________________    ___________    ____________________\\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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\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\u003eRelated Problems:\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:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":43664,"title":"Use a timetable to analyze a train timetable (Part 1)","description":"Oh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. The trip should not take longer than 5 hours.\r\nExample:\r\nDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n         DepTime          Destination          ArrTime       \r\n  ____________________    ___________    ____________________\r\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\nFeature Tip: R2016b introduces timetables with related functions which may be helpful. To learn more see MATLAB Timetables.\r\nRelated Problems:\r\nUse a timetable to analyze a train timetable (Part 1)\r\nUse a timetable to analyze a train timetable (Part 2)\r\nUse a timetable to analyze a train timetable (Part 3)\r\nUse a timetable to analyze a train timetable (Part 4)\r\nUse a timetable to analyze a train timetable (Part 5)","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: 518.333px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 259.167px; transform-origin: 407px 259.167px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 384px 8px; transform-origin: 384px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eOh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. The trip should not take longer than 5 hours.\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: 31.5px 8px; transform-origin: 31.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 204.333px; 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 102.167px; transform-origin: 404px 102.167px; 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: 208px 8.5px; tab-size: 4; transform-origin: 208px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\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: 216px 8.5px; tab-size: 4; transform-origin: 216px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\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: 188px 8.5px; tab-size: 4; transform-origin: 188px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 108px 8.5px; transform-origin: 108px 8.5px; \"\u003eDestination = categorical({\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'BOS'\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\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'NYC'\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\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'BOS'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 12px 8.5px; transform-origin: 12px 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: 172px 8.5px; tab-size: 4; transform-origin: 172px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ett = timetable(DepTime,Destination,ArrTime)\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: 20px 8.5px; tab-size: 4; transform-origin: 20px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ett = \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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 104px 8.5px; transform-origin: 104px 8.5px; \"\u003e         DepTime          \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: 44px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 44px 8.5px; \"\u003eDestination\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003e          \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: 28px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 28px 8.5px; \"\u003eArrTime\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 28px 8.5px; transform-origin: 28px 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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 8px 8.5px; transform-origin: 8px 8.5px; \"\u003e  \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 80px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 80px 8.5px; \"\u003e____________________\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 44px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 44px 8.5px; \"\u003e___________\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 16px 8.5px; transform-origin: 16px 8.5px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(255, 0, 0); border-block-start-color: rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end-color: rgb(255, 0, 0); border-inline-start-color: rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(255, 0, 0); perspective-origin: 80px 8.5px; text-decoration-color: rgb(255, 0, 0); text-emphasis-color: rgb(255, 0, 0); transform-origin: 80px 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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 06:22:00    BOS            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 09:17:00\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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 08:51:00    NYC            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 10:32:00\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: 244px 8.5px; tab-size: 4; transform-origin: 244px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 164px 8.5px; transform-origin: 164px 8.5px; \"\u003e  01-Nov-2016 09:05:00    BOS            \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: 80px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 80px 8.5px; \"\u003e01-Nov-2016 12:09:00\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; 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: 42px 8px; transform-origin: 42px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eFeature Tip:\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eR2016b\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 266px 8px; transform-origin: 266px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e introduces timetables with related functions which may be helpful. To learn more see\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMATLAB Timetables\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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: 64px 8px; transform-origin: 64px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRelated Problems:\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: 161px 8px; transform-origin: 161px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/span\u003e\u003c/span\u003e\u003c/a\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\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function nextTime = myFun(tt)\r\n  nextTime = tt;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,6,22,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n\r\n%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1], [6;6;7;7;8;8],[0;10;0;20;0;30],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1], [13;13;12;12;11;11],[0;30;0;20;0;10],0);\r\nDestination = categorical([1;1;1;1;1;1],1,{'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,8,0,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n\r\n%%\r\nDepTime = datetime(2016,11,[1;2;3;4], [3;5;7;9],0,0);\r\nArrTime = datetime(2016,11,[1;2;3;4], [13;12;11;10],0,0);\r\nDestination = categorical([1;2;1;2],1:2,{'BOS';'NYC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,3,7,0,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n\r\n%%\r\nDepTime = datetime(2016,11,[1;1;1;1], [7;7;8;8],0,0);\r\nArrTime = datetime(2016,11,[1;1;1;1], [12;11;10;9],0,0);\r\nDestination = categorical([1;2;1;2],1:2,{'BOS';'NYC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,8,0,0);\r\nassert(isequal(myFun(tt),nextTime))\r\n\r\n%%\r\nDepTime = datetime(2016,11,[1;1;1;1], [8;8;7;8],10,30);\r\nArrTime = datetime(2016,11,[1;1;1;1], [12;13;10;9],0,0);\r\nDestination = categorical([1;2;1;2],1:2,{'BOS';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nnextTime = datetime(2016,11,1,7,10,30);\r\nassert(isequal(myFun(tt),nextTime))","published":true,"deleted":false,"likes_count":2,"comments_count":4,"created_by":102743,"edited_by":223089,"edited_at":"2022-04-27T08:40:00.000Z","deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":"2022-04-27T08:40:00.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T20:20:09.000Z","updated_at":"2026-03-10T02:50:53.000Z","published_at":"2016-11-18T20:26:18.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\u003eOh no, you missed your train to Boston! Find the departure time of the next available train by analyzing the train timetable. The trip should not take longer than 5 hours.\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: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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\nDestination = categorical({'BOS';'NYC';'BOS'});\\ntt = timetable(DepTime,Destination,ArrTime)\\ntt = \\n         DepTime          Destination          ArrTime       \\n  ____________________    ___________    ____________________\\n  01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n  01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n  01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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\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\u003eRelated Problems:\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\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":43674,"title":"String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array","description":"\u003chttp://www.mathworks.com/help/matlab/characters-and-strings.html String array\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data. \r\n\r\nThe \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values Part 1\u003e assuming no missing values in the input cell array is a good starting point. In this problem, the missing values for cell array of character vectors, denoted *{''}* (i.e., cell of empty character), need to be converted to the missing values for string arrays, denoted *\u003c missing \u003e*. \r\n\r\nRefer to the R2016b documentation for more information on the \u003chttp://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing missing values for different data types\u003e. \r\n \r\n\r\nExample: \r\n\r\n  \r\n\r\n  Input:\r\n  \u003e\u003e x = {'I', '', '', 'MATLAB'}\r\n  x =\r\n    1×4 cell array\r\n      'I'    ''    ''    'MATLAB'\r\n\r\n  Output:\r\n  \u003e\u003e y = string('I'); y(4) = 'MATLAB'\r\n  y = \r\n    1×4 string array\r\n      \"I\"    \u003cmissing\u003e    \u003cmissing\u003e    \"MATLAB\"\r\n\r\nRelated Problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values   String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003e \r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values   String Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003e \r\n* String Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values   String Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003e\r\n","description_html":"\u003cp\u003e\u003ca href = \"http://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eString array\u003c/a\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data.\u003c/p\u003e\u003cp\u003eThe \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\"\u003ePart 1\u003c/a\u003e assuming no missing values in the input cell array is a good starting point. In this problem, the missing values for cell array of character vectors, denoted \u003cb\u003e{''}\u003c/b\u003e (i.e., cell of empty character), need to be converted to the missing values for string arrays, denoted \u003cb\u003e\u0026lt; missing \u0026gt;\u003c/b\u003e.\u003c/p\u003e\u003cp\u003eRefer to the R2016b documentation for more information on the \u003ca href = \"http://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing\"\u003emissing values for different data types\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eInput:\r\n\u0026gt;\u0026gt; x = {'I', '', '', 'MATLAB'}\r\nx =\r\n  1×4 cell array\r\n    'I'    ''    ''    'MATLAB'\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eOutput:\r\n\u0026gt;\u0026gt; y = string('I'); y(4) = 'MATLAB'\r\ny = \r\n  1×4 string array\r\n    \"I\"    \u0026lt;missing\u0026gt;    \u0026lt;missing\u0026gt;    \"MATLAB\"\r\n\u003c/pre\u003e\u003cp\u003eRelated Problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\"\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\"\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/a\u003e\u003c/li\u003e\u003cli\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\u003c/li\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\"\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/a\u003e\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = cell2str(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = {'I','love','MATLAB'};\r\ny_correct = string({'I','love','MATLAB'});\r\nassert(isequal(cell2str(x),y_correct))\r\n\r\n%%\r\nx = {'I', '', '', 'MATLAB'};\r\ny_correct = string('I'); y_correct(4) = 'MATLAB';\r\nassert(isequaln(cell2str(x),y_correct))\r\n\r\n%%\r\nx = {'I',   '',      'MATLAB'\r\n     '',    'love',  'MATLAB'\r\n     'I',   'love',  ''      };\r\ny_correct = [string('I'),  string(NaN),     string('MATLAB')\r\n             string(NaN),  string('love'),  string('MATLAB')\r\n             string('I'),  string('love'),  string(NaN)     ];\r\nassert(isequaln(cell2str(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":123,"test_suite_updated_at":"2016-11-23T06:30:05.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-21T04:09:03.000Z","updated_at":"2026-03-10T20:06:28.000Z","published_at":"2016-11-22T21:16: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:hyperlink w:docLocation=\\\"http://www.mathworks.com/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and cell array are two types of containers for storing pieces of data. In this problem, you will be given a cell array of character vectors. Your job is to convert the cell array to a string array, which stores the same pieces of text data.\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\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://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ePart 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e assuming no missing values in the input cell array is a good starting point. In this problem, the missing values for cell array of character vectors, denoted\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e{''}\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (i.e., cell of empty character), need to be converted to the missing values for string arrays, denoted\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e\u0026lt; missing \u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRefer to the R2016b documentation for more information on the\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://www.mathworks.com/help/matlab/ref/ismissing.html?=ismissing\\\"\u003e\u003cw:r\u003e\u003cw:t\u003emissing values for different data types\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\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:\\n\u003e\u003e x = {'I', '', '', 'MATLAB'}\\nx =\\n  1×4 cell array\\n    'I'    ''    ''    'MATLAB'\\n\\nOutput:\\n\u003e\u003e y = string('I'); y(4) = 'MATLAB'\\ny = \\n  1×4 string array\\n    \\\"I\\\"    \u003cmissing\u003e    \u003cmissing\u003e    \\\"MATLAB\\\"]]\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\u003eRelated Problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43677-string-array-basics-part-1-convert-cell-array-to-string-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43672-string-array-basics-part-2-convert-string-array-to-cell-array-no-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 2: Convert String Array to Cell Array; No Missing Values\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 3: Convert Cell Array with Missing Values to String Array\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43673-string-array-basics-part-4-convert-string-array-to-cell-array-with-missing-values\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eString Array Basics, Part 4: Convert String Array with Missing Values to Cell Array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43667,"title":"Use a timetable to analyze a train timetable (Part 4)","description":"You are analyzing a train timetable (you have some time to kill since you just missed your train!) What is the average daily trip duration?\r\nExample:\r\nDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n     DepTime          Destination          ArrTime       \r\n____________________    ___________    ____________________\r\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\nThe result should be a duration variable:\r\nDur = [duration(3,9,05);duration(2,55,15);duration(3,0,24)]\r\nDur = \r\n3×1 duration array\r\n 03:09:50\r\n 02:55:15\r\n 03:00:24\r\nFeature Tip: R2016b introduces timetables with related functions which may be helpful. To learn more see MATLAB Timetables.\r\nRelated Problems:\r\nUse a timetable to analyze a train timetable (Part 1)\r\nUse a timetable to analyze a train timetable (Part 2)\r\nUse a timetable to analyze a train timetable (Part 3)\r\nUse a timetable to analyze a train timetable (Part 4)\r\nUse a timetable to analyze a train timetable (Part 5)","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eYou are analyzing a train timetable (you have some time to kill since you just missed your train!) What is the average daily trip duration?\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-bottom: 10px; margin-left: 3px; margin-right: 3px; margin-top: 10px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eDestination = categorical({\u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e'BOS'\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e;\u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e'NYC'\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e;\u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e'BOS'\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e});\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003ett = timetable(DepTime,Destination,ArrTime)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003ett = \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e     DepTime          \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003eDestination\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e          \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003eArrTime\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e       \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"border-block-end: 0px none rgb(255, 0, 0); border-block-start: 0px none rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end: 0px none rgb(255, 0, 0); border-inline-start: 0px none rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-right: 0px; outline-color: rgb(255, 0, 0); text-decoration-color: rgb(255, 0, 0); \"\u003e____________________\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(255, 0, 0); border-block-start: 0px none rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end: 0px none rgb(255, 0, 0); border-inline-start: 0px none rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-right: 0px; outline-color: rgb(255, 0, 0); text-decoration-color: rgb(255, 0, 0); \"\u003e___________\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e    \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(255, 0, 0); border-block-start: 0px none rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end: 0px none rgb(255, 0, 0); border-inline-start: 0px none rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-right: 0px; outline-color: rgb(255, 0, 0); text-decoration-color: rgb(255, 0, 0); \"\u003e____________________\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e01-Nov-2016 06:22:00    BOS            \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e01-Nov-2016 09:17:00\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e01-Nov-2016 08:51:00    NYC            \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e01-Nov-2016 10:32:00\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e01-Nov-2016 09:05:00    BOS            \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003e01-Nov-2016 12:09:00\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 10px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eThe result should be a duration variable:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-bottom: 10px; margin-left: 3px; margin-right: 3px; margin-top: 10px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eDur = [duration(3,9,05);duration(2,55,15);duration(3,0,24)]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003eDur = \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e3\u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(255, 0, 0); border-block-start: 0px none rgb(255, 0, 0); border-bottom-color: rgb(255, 0, 0); border-inline-end: 0px none rgb(255, 0, 0); border-inline-start: 0px none rgb(255, 0, 0); border-left-color: rgb(255, 0, 0); border-right-color: rgb(255, 0, 0); border-top-color: rgb(255, 0, 0); caret-color: rgb(255, 0, 0); color: rgb(255, 0, 0); column-rule-color: rgb(255, 0, 0); margin-right: 0px; outline-color: rgb(255, 0, 0); text-decoration-color: rgb(255, 0, 0); \"\u003e×\u003c/span\u003e\u003cspan style=\"margin-right: 0px; \"\u003e1 duration \u003c/span\u003e\u003cspan style=\"border-block-end: 0px none rgb(170, 4, 249); border-block-start: 0px none rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end: 0px none rgb(170, 4, 249); border-inline-start: 0px none 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-right: 0px; outline-color: rgb(170, 4, 249); text-decoration-color: rgb(170, 4, 249); \"\u003earray\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e 03:09:50\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e 02:55:15\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-inline-end: 1px solid rgb(233, 233, 233); border-inline-start: 1px solid rgb(233, 233, 233); 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-top-left-radius: 0px; border-top-right-radius: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 18px; padding-left: 4px; white-space: nowrap; \"\u003e\u003cspan style=\"border-inline-end: 0px none rgb(0, 0, 0); border-inline-start: 0px none rgb(0, 0, 0); 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-right: 45px; min-height: 0px; padding-left: 0px; tab-size: 4; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-right: 0px; \"\u003e 03:00:24\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 10px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eFeature Tip:\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eR2016b\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e introduces timetables with related functions which may be helpful. To learn more see\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMATLAB Timetables\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eRelated Problems:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function ttDaily = myFun(tt)\r\n  ttDaily = tt;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\nDur = [duration(3,9,50);duration(2,55,15);duration(3,0,24)];\r\nttDur = myFun(tt);\r\nif isrow(ttDur); ttDur = ttDur'; end\r\nassert(all(abs(ttDur - Dur) \u003c= 0.0001))","published":true,"deleted":false,"likes_count":0,"comments_count":7,"created_by":102743,"edited_by":26769,"edited_at":"2022-04-22T12:40:24.000Z","deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":"2022-04-22T12:40:24.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T21:12:23.000Z","updated_at":"2026-03-10T17:24:43.000Z","published_at":"2016-11-18T21:12: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\u003eYou are analyzing a train timetable (you have some time to kill since you just missed your train!) What is the average daily trip duration?\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: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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\nDestination = categorical({'BOS';'NYC';'BOS'});\\ntt = timetable(DepTime,Destination,ArrTime)\\ntt = \\n     DepTime          Destination          ArrTime       \\n____________________    ___________    ____________________\\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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\u003eThe result should be a duration variable:\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[Dur = [duration(3,9,05);duration(2,55,15);duration(3,0,24)]\\nDur = \\n3×1 duration array\\n 03:09:50\\n 02:55:15\\n 03:00:24]]\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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\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\u003eRelated Problems:\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:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":43668,"title":"Use a timetable to analyze a train timetable (Part 5)","description":"You are analyzing a train timetable (you have some time to kill since you just missed your train!) How many trains depart each day of the week? (submit the results as a table with the days of the week and number of trains)\r\n\r\n\r\n*Example* \r\n\r\n  DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n         DepTime          Destination          ArrTime       \r\n____________________    ___________    ____________________\r\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\n\r\nThe result should be given as a table:\r\n\r\n  DayOfWk = {'Thu';'Tue';'Wed'};\r\n  GroupCount = [5;6;4];\r\n  numTrains = table(DayOfWk,GroupCount)\r\nnumTrains = \r\n    DayOfWk    GroupCount\r\n    _______    __________\r\n    'Thu'      5         \r\n    'Tue'      6         \r\n    'Wed'      4   \r\n\r\n*Feature Tip:* \u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces timetables with related functions which may be helpful. To learn more see \u003chttp://www.mathworks.com/help/matlab/timetables.html MATLAB Timetables\u003e.\r\n\r\n*Related Problems:* \r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1 Use a timetable to analyze a train timetable (Part 1)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2 Use a timetable to analyze a train timetable (Part 2)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43666-use-a-timetable-to-analyze-a-train-timetable-part-3 Use a timetable to analyze a train timetable (Part 3)\u003e\r\n\r\n\u003chttp://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4 Use a timetable to analyze a train timetable (Part 4)\u003e\r\n\r\nUse a timetable to analyze a train timetable (Part 5)","description_html":"\u003cp\u003eYou are analyzing a train timetable (you have some time to kill since you just missed your train!) How many trains depart each day of the week? (submit the results as a table with the days of the week and number of trains)\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eDepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\r\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\r\nDestination = categorical({'BOS';'NYC';'BOS'});\r\ntt = timetable(DepTime,Destination,ArrTime)\r\ntt = \r\n       DepTime          Destination          ArrTime       \r\n____________________    ___________    ____________________\r\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\r\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\r\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00\r\n\u003c/pre\u003e\u003cp\u003eThe result should be given as a table:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eDayOfWk = {'Thu';'Tue';'Wed'};\r\nGroupCount = [5;6;4];\r\nnumTrains = table(DayOfWk,GroupCount)\r\nnumTrains = \r\n  DayOfWk    GroupCount\r\n  _______    __________\r\n  'Thu'      5         \r\n  'Tue'      6         \r\n  'Wed'      4   \r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eFeature Tip:\u003c/b\u003e \u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces timetables with related functions which may be helpful. To learn more see \u003ca href = \"http://www.mathworks.com/help/matlab/timetables.html\"\u003eMATLAB Timetables\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eRelated Problems:\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1\"\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2\"\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43666-use-a-timetable-to-analyze-a-train-timetable-part-3\"\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/a\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4\"\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/a\u003e\u003c/p\u003e\u003cp\u003eUse a timetable to analyze a train timetable (Part 5)\u003c/p\u003e","function_template":"function numTrains = myFun(tt)\r\n  y = x;\r\nend","test_suite":"%%\r\nDepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0);\r\nArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],...\r\n[9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0);\r\nDestination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'});\r\ntt = timetable(DepTime,Destination,ArrTime);\r\n% create resulting table\r\nDayOfWk = {'Thu';'Tue';'Wed'}; \r\nGroupCount = [5;6;4];\r\ntestTrains = table(DayOfWk,GroupCount);\r\nnumTrains = myFun(tt);\r\n% allow for different text types \r\ntestTrains2 = testTrains;\r\ntestTrains2.DayOfWk = string(testTrains2.DayOfWk);\r\ntestTrains3 = testTrains;\r\ntestTrains3.DayOfWk = categorical(testTrains3.DayOfWk);\r\ntestTrains4 = testTrains;\r\ntestTrains4.DayOfWk = char(testTrains4.DayOfWk);\r\nassert(isequal(testTrains,numTrains) | ...\r\n    isequal(testTrains2,numTrains) | ...\r\n    isequal(testTrains3,numTrains) | ...\r\n    isequal(testTrains4,numTrains))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":102743,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":"2016-11-19T16:42:02.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-18T21:20:45.000Z","updated_at":"2026-03-10T19:00:14.000Z","published_at":"2016-11-18T21:20:45.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eYou are analyzing a train timetable (you have some time to kill since you just missed your train!) How many trains depart each day of the week? (submit the results as a table with the days of the week and number of trains)\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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[DepTime = datetime(2016,11,1,[6 8 9],[22 51 05],0)';\\nArrTime = datetime(2016,11,1,[9 10 12],[17 32 09],0)';\\nDestination = categorical({'BOS';'NYC';'BOS'});\\ntt = timetable(DepTime,Destination,ArrTime)\\ntt = \\n       DepTime          Destination          ArrTime       \\n____________________    ___________    ____________________\\n01-Nov-2016 06:22:00    BOS            01-Nov-2016 09:17:00\\n01-Nov-2016 08:51:00    NYC            01-Nov-2016 10:32:00\\n01-Nov-2016 09:05:00    BOS            01-Nov-2016 12:09:00]]\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 result should be given as a table:\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[DayOfWk = {'Thu';'Tue';'Wed'};\\nGroupCount = [5;6;4];\\nnumTrains = table(DayOfWk,GroupCount)\\nnumTrains = \\n  DayOfWk    GroupCount\\n  _______    __________\\n  'Thu'      5         \\n  'Tue'      6         \\n  'Wed'      4]]\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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip:\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/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces timetables with related functions which may be helpful. To learn more see\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://www.mathworks.com/help/matlab/timetables.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Timetables\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRelated Problems:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43664-use-a-timetable-to-analyze-a-train-timetable-part-1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 1)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43665-use-a-timetable-to-analyze-a-train-timetable-part-2\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43666-use-a-timetable-to-analyze-a-train-timetable-part-3\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 3)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43667-use-a-timetable-to-analyze-a-train-timetable-part-4\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 4)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUse a timetable to analyze a train timetable (Part 5)\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":43658,"title":"When Was That Goal Scored?","description":"We want to find out when the goals were scored in a particular soccer game. For each game, we are given a \"Goal Event Data\" XML string from a soccer database. Your job is to pick out the \"Elapsed Time\" number for each goal. Return the numbers for each goal as a column vector of double precision numbers.\r\n\r\nThis translates to finding the number between the \"\u003celapsed\u003e\" tags.\r\n\r\n*Example*\r\n\r\nGiven this input\r\n\r\n ged = '\u003cgoal\u003e\u003cvalue\u003e\u003celapsed\u003e22\u003c/elapsed\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003c/value\u003e\u003c/goal\u003e'\r\n\r\nyou should return the number 22.\r\n\r\nNote that you must return the number 22 and not the string.\r\n\r\n*Feature Tip* \r\n\r\n\u003chttps://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending R2016b\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003chttps://www.mathworks.com/help/matlab/characters-and-strings.html MATLAB Characters and Strings\u003e.","description_html":"\u003cp\u003eWe want to find out when the goals were scored in a particular soccer game. For each game, we are given a \"Goal Event Data\" XML string from a soccer database. Your job is to pick out the \"Elapsed Time\" number for each goal. Return the numbers for each goal as a column vector of double precision numbers.\u003c/p\u003e\u003cp\u003eThis translates to finding the number between the \"\u0026lt;elapsed\u0026gt;\" tags.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cp\u003eGiven this input\u003c/p\u003e\u003cpre\u003e ged = '\u0026lt;goal\u0026gt;\u0026lt;value\u0026gt;\u0026lt;elapsed\u0026gt;22\u0026lt;/elapsed\u0026gt;\u0026lt;subtype\u0026gt;header\u0026lt;/subtype\u0026gt;\u0026lt;/value\u0026gt;\u0026lt;/goal\u0026gt;'\u003c/pre\u003e\u003cp\u003eyou should return the number 22.\u003c/p\u003e\u003cp\u003eNote that you must return the number 22 and not the string.\u003c/p\u003e\u003cp\u003e\u003cb\u003eFeature Tip\u003c/b\u003e\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026startrelease=R2016b\u0026endrelease=R2016b\u0026groupby=release\u0026sortby=descending\"\u003eR2016b\u003c/a\u003e introduces string arrays and text manipulation functions which can help. To learn more see \u003ca href = \"https://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003eMATLAB Characters and Strings\u003c/a\u003e.\u003c/p\u003e","function_template":"function elapsed = getElapsedTime(ged)\r\n    elapsed = 0;\r\nend\r\n","test_suite":"%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003celapsed\u003e47\u003c/elapsed\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [47];\r\nassert(isequal(elapsed,elapsed_correct))\r\n\r\n%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e406\u003c/event_incident_typefk\u003e\u003celapsed\u003e22\u003c/elapsed\u003e\u003cplayer2\u003e38807\u003c/player2\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003cplayer1\u003e37799\u003c/player1\u003e\u003csortorder\u003e5\u003c/sortorder\u003e\u003cteam\u003e10261\u003c/team\u003e\u003cid\u003e378998\u003c/id\u003e\u003cn\u003e295\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e393\u003c/event_incident_typefk\u003e\u003celapsed\u003e24\u003c/elapsed\u003e\u003cplayer2\u003e24154\u003c/player2\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cplayer1\u003e24148\u003c/player1\u003e\u003csortorder\u003e4\u003c/sortorder\u003e\u003cteam\u003e10260\u003c/team\u003e\u003cid\u003e379019\u003c/id\u003e\u003cn\u003e298\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [22;24];\r\nassert(isequal(elapsed,elapsed_correct))\r\n\r\n%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e406\u003c/event_incident_typefk\u003e\u003celapsed\u003e73\u003c/elapsed\u003e\u003cplayer2\u003e25668\u003c/player2\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003cplayer1\u003e38755\u003c/player1\u003e\u003csortorder\u003e2\u003c/sortorder\u003e\u003cteam\u003e10194\u003c/team\u003e\u003cid\u003e465096\u003c/id\u003e\u003cn\u003e321\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [73];\r\nassert(isequal(elapsed,elapsed_correct))\r\n\r\n%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e393\u003c/event_incident_typefk\u003e\u003celapsed\u003e3\u003c/elapsed\u003e\u003cplayer2\u003e24635\u003c/player2\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cplayer1\u003e37139\u003c/player1\u003e\u003csortorder\u003e3\u003c/sortorder\u003e\u003cteam\u003e8650\u003c/team\u003e\u003cid\u003e468555\u003c/id\u003e\u003cn\u003e239\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003eo\u003c/comment\u003e\u003cstats\u003e\u003cowngoals\u003e1\u003c/owngoals\u003e\u003c/stats\u003e\u003cevent_incident_typefk\u003e115\u003c/event_incident_typefk\u003e\u003celapsed\u003e69\u003c/elapsed\u003e\u003cplayer1\u003e30617\u003c/player1\u003e\u003csortorder\u003e3\u003c/sortorder\u003e\u003cteam\u003e8650\u003c/team\u003e\u003cid\u003e468934\u003c/id\u003e\u003cn\u003e304\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003eo\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed_plus\u003e1\u003c/elapsed_plus\u003e\u003cevent_incident_typefk\u003e393\u003c/event_incident_typefk\u003e\u003celapsed\u003e90\u003c/elapsed\u003e\u003cplayer2\u003e23949\u003c/player2\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cplayer1\u003e40755\u003c/player1\u003e\u003csortorder\u003e2\u003c/sortorder\u003e\u003cteam\u003e8586\u003c/team\u003e\u003cid\u003e469035\u003c/id\u003e\u003cn\u003e328\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [3; 69; 90];\r\nassert(isequal(elapsed,elapsed_correct))\r\n\r\n%%\r\nged = '\u003cgoal\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e11\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8472\u003c/team\u003e\u003cid\u003e507018\u003c/id\u003e\u003cn\u003e250\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e18\u003c/elapsed\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003cteam\u003e8559\u003c/team\u003e\u003cid\u003e507106\u003c/id\u003e\u003cn\u003e255\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e21\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8559\u003c/team\u003e\u003cid\u003e507142\u003c/id\u003e\u003cn\u003e259\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003edg\u003c/comment\u003e\u003celapsed\u003e30\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8472\u003c/team\u003e\u003cid\u003e507259\u003c/id\u003e\u003cn\u003e148\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003edg\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e39\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8559\u003c/team\u003e\u003cid\u003e507390\u003c/id\u003e\u003cn\u003e278\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003cvalue\u003e\u003ccomment\u003en\u003c/comment\u003e\u003cstats\u003e\u003cgoals\u003e1\u003c/goals\u003e\u003cshoton\u003e1\u003c/shoton\u003e\u003c/stats\u003e\u003celapsed\u003e55\u003c/elapsed\u003e\u003csubtype\u003eshot\u003c/subtype\u003e\u003cteam\u003e8559\u003c/team\u003e\u003cid\u003e507734\u003c/id\u003e\u003cn\u003e295\u003c/n\u003e\u003ctype\u003egoal\u003c/type\u003e\u003cgoal_type\u003en\u003c/goal_type\u003e\u003c/value\u003e\u003c/goal\u003e';\r\nelapsed = getElapsedTime(ged);\r\nelapsed_correct = [11; 18; 21; 30; 39; 55];\r\nassert(isequal(elapsed,elapsed_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":124,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-17T17:32:24.000Z","updated_at":"2026-03-24T21:01:26.000Z","published_at":"2016-11-17T17:46:42.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\u003eWe want to find out when the goals were scored in a particular soccer game. For each game, we are given a \\\"Goal Event Data\\\" XML string from a soccer database. Your job is to pick out the \\\"Elapsed Time\\\" number for each goal. Return the numbers for each goal as a column vector of double precision numbers.\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 translates to finding the number between the \\\"\u0026lt;elapsed\u0026gt;\\\" tags.\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\u003eGiven this input\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[ ged = '\u003cgoal\u003e\u003cvalue\u003e\u003celapsed\u003e22\u003c/elapsed\u003e\u003csubtype\u003eheader\u003c/subtype\u003e\u003c/value\u003e\u003c/goal\u003e']]\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\u003eyou should return the number 22.\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\u003eNote that you must return the number 22 and not the 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eFeature Tip\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/help/matlab/release-notes.html?rntext=\u0026amp;startrelease=R2016b\u0026amp;endrelease=R2016b\u0026amp;groupby=release\u0026amp;sortby=descending\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eR2016b\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e introduces string arrays and text manipulation functions which can help. To learn more see\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/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Characters and Strings\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":43670,"title":"Words Count: A String Array Approach","description":"Given an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\n), arrange the unique words alphabetically in a \u003chttps://www.mathworks.com/help/matlab/characters-and-strings.html string array\u003e and calculate the histogram count of every unique word.\r\n\r\nAssumptions:\r\n\r\n# Case is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output string array either the uppercase or lowercase.\r\n# Punctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\r\n\r\nFor example, given the input txt as a character vector,\r\n\r\n  txt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\n\r\nthe outputs should be\r\n\r\n  words = string({'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\r\n                  'on';'problems';'trivial'});\r\n  count = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n\r\nHint: The R2016b documentation provides a good \u003chttp://www.mathworks.com/help/matlab/matlab_prog/analyze-text-data-with-string-arrays.html example\u003e of text data analysis via the string array approach. However, some steps illustrated in that example are unnecessary, and we can indeed accomplish the same task in a simpler way.\r\n\r\nRelated problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43671-words-count-a-cell-array-approach Words Count: A Cell Array Approach\u003e\r\n* Words Count: A String Array Approach","description_html":"\u003cp\u003eGiven an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\n), arrange the unique words alphabetically in a \u003ca href = \"https://www.mathworks.com/help/matlab/characters-and-strings.html\"\u003estring array\u003c/a\u003e and calculate the histogram count of every unique word.\u003c/p\u003e\u003cp\u003eAssumptions:\u003c/p\u003e\u003col\u003e\u003cli\u003eCase is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output string array either the uppercase or lowercase.\u003c/li\u003e\u003cli\u003ePunctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eFor example, given the input txt as a character vector,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003etxt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\n\u003c/pre\u003e\u003cp\u003ethe outputs should be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ewords = string({'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\r\n                'on';'problems';'trivial'});\r\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n\u003c/pre\u003e\u003cp\u003eHint: The R2016b documentation provides a good \u003ca href = \"http://www.mathworks.com/help/matlab/matlab_prog/analyze-text-data-with-string-arrays.html\"\u003eexample\u003c/a\u003e of text data analysis via the string array approach. However, some steps illustrated in that example are unnecessary, and we can indeed accomplish the same task in a simpler way.\u003c/p\u003e\u003cp\u003eRelated problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43671-words-count-a-cell-array-approach\"\u003eWords Count: A Cell Array Approach\u003c/a\u003e\u003c/li\u003e\u003cli\u003eWords Count: A String Array Approach\u003c/li\u003e\u003c/ul\u003e","function_template":"function [words,count] = wordscount(txt)\r\n  words = txt;\r\n  count = 1;\r\nend","test_suite":"%%\r\ntxt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\nwords = string({'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';'on';'problems';'trivial'});\r\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))\r\n\r\n%%\r\ntxt = sprintf('\\n\\nI love MATLAB and Cody, but I don''t like trivial matlab problems on cody.\\n\\nUnfortunately, there are too many trivial problems on Cody.');\r\nwords = string({'and';'are';'but';'cody';'don''t';'I';'like';'love';'many';'matlab';'on';'problems';'there';'too';'trivial';'unfortunately'});\r\ncount = [1; 1; 1; 3; 1; 2; 1; 1; 1; 2; 2; 2; 1; 1; 2; 1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))\r\n\r\n%%\r\ntxt = ['What is Cody? ',newline,' Cody is a MATLAB Central game', newline ...\r\n       'that expands your knowledge of MATLAB.',newline,...\r\n       'With Cody, you can:',newline, ...\r\n       'Solve problems related to MATLAB code;',newline, ...\r\n       'Find problems, solutions, and players;  ',newline, ...\r\n       'Use search directives to find content; ',newline, ...\r\n       'Challenge the community by contributing problems;',newline, ...\r\n       ' Comment on any problem or solution;',newline,...\r\n       'Like a problem or a solution; ',newline, ...\r\n       'Earn badges;',newline,newline, ...\r\n       'Play now!'];\r\nwords = string({'a';'and';'any';'badges';'by';'can';'central';'challenge';'code';'cody';'comment';...\r\n                'community';'content';'contributing';'directives';'earn';'expands';'find';'game';...\r\n                'is';'knowledge';'like';'matlab';'now';'of';'on';'or';'play';'players';'problem';...\r\n                'problems';'related';'search';'solution';'solutions';'solve';'that';'the';'to';...\r\n                'use';'what';'with';'you';'your'});\r\ncount = [3;1;1;1;1;1;1;1;1;3;1;1;1;1;1;1;1;2;1;2;1;1;3;1;1;1;2;1;1;2;3;1;1;2;1;1;1;1;2;1;1;1;1;1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))","published":true,"deleted":false,"likes_count":12,"comments_count":2,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":82,"test_suite_updated_at":"2016-12-02T05:47:45.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-20T06:50:46.000Z","updated_at":"2026-03-09T20:37:06.000Z","published_at":"2016-11-20T09:01:29.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 an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\\\n), arrange the unique words alphabetically in a\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/help/matlab/characters-and-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estring array\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and calculate the histogram count of every unique word.\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\u003eAssumptions:\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCase is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output string array either the uppercase or lowercase.\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePunctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\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, given the input txt as a character vector,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[txt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';]]\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 outputs should be\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[words = string({'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\\n                'on';'problems';'trivial'});\\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: The R2016b documentation provides a good\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://www.mathworks.com/help/matlab/matlab_prog/analyze-text-data-with-string-arrays.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eexample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e of text data analysis via the string array approach. However, some steps illustrated in that example are unnecessary, and we can indeed accomplish the same task in a simpler way.\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\u003eRelated problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43671-words-count-a-cell-array-approach\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWords Count: A Cell Array Approach\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWords Count: A String Array Approach\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":43671,"title":"Words Count: A Cell Array Approach","description":"Given an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\n), arrange the unique words alphabetically in a cell array of character vectors (formerly called \u003chttps://www.mathworks.com/help/matlab/matlab_prog/cell-arrays-of-strings.html cell array of strings\u003e) and calculate the histogram count of every unique word.\r\n\r\nAssumptions:\r\n\r\n# Case is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output cell array either the uppercase or lowercase.\r\n# Punctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\r\n\r\nFor example, given the input txt as a character vector,\r\n\r\n  txt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\n\r\nthe outputs should be\r\n\r\n  words = {'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\r\n           'on';'problems';'trivial'};\r\n  count = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n\r\nHint: The cell array of strings approach is the dual of the string array approach, i.e., things that can be done via the \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach string arrays approach\u003e can also be done using the cell array approach. \r\n\r\nRelated problems in this series:\r\n\r\n* \u003chttp://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach Words Count: A String Array Approach\u003e\r\n* Words Count: A Cell Array Approach\r\n","description_html":"\u003cp\u003eGiven an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\n), arrange the unique words alphabetically in a cell array of character vectors (formerly called \u003ca href = \"https://www.mathworks.com/help/matlab/matlab_prog/cell-arrays-of-strings.html\"\u003ecell array of strings\u003c/a\u003e) and calculate the histogram count of every unique word.\u003c/p\u003e\u003cp\u003eAssumptions:\u003c/p\u003e\u003col\u003e\u003cli\u003eCase is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output cell array either the uppercase or lowercase.\u003c/li\u003e\u003cli\u003ePunctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eFor example, given the input txt as a character vector,\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003etxt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\n\u003c/pre\u003e\u003cp\u003ethe outputs should be\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ewords = {'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\r\n         'on';'problems';'trivial'};\r\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n\u003c/pre\u003e\u003cp\u003eHint: The cell array of strings approach is the dual of the string array approach, i.e., things that can be done via the \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach\"\u003estring arrays approach\u003c/a\u003e can also be done using the cell array approach.\u003c/p\u003e\u003cp\u003eRelated problems in this series:\u003c/p\u003e\u003cul\u003e\u003cli\u003e\u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach\"\u003eWords Count: A String Array Approach\u003c/a\u003e\u003c/li\u003e\u003cli\u003eWords Count: A Cell Array Approach\u003c/li\u003e\u003c/ul\u003e","function_template":"function [words,count] = wordscount(txt)\r\n  words = txt;\r\n  count = 1;\r\nend","test_suite":"%%\r\ntxt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';\r\nwords = {'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';'on';'problems';'trivial'};\r\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))\r\n\r\n%%\r\ntxt = sprintf('I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.\\n\\nUnfortunately, there are too many trivial problems on Cody.');\r\nwords = {'and';'are';'but';'cody';'don''t';'I';'like';'love';'many';'matlab';'on';'problems';'there';'too';'trivial';'unfortunately'};\r\ncount = [1; 1; 1; 3; 1; 2; 1; 1; 1; 2; 2; 2; 1; 1; 2; 1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))\r\n\r\n%%\r\ntxt = ['What is Cody? ',newline,' Cody is a MATLAB Central game', newline ...\r\n       'that expands your knowledge of MATLAB.',newline,...\r\n       'With Cody, you can:',newline, ...\r\n       'Solve problems related to MATLAB code;',newline, ...\r\n       'Find problems, solutions, and players;  ',newline, ...\r\n       'Use search directives to find content; ',newline, ...\r\n       'Challenge the community by contributing problems;',newline, ...\r\n       ' Comment on any problem or solution;',newline,...\r\n       'Like a problem or a solution; ',newline, ...\r\n       'Earn badges;',newline,newline, ...\r\n       'Play now!'];\r\nwords = {'a';'and';'any';'badges';'by';'can';'central';'challenge';'code';'cody';'comment';...\r\n         'community';'content';'contributing';'directives';'earn';'expands';'find';'game';...\r\n         'is';'knowledge';'like';'matlab';'now';'of';'on';'or';'play';'players';'problem';...\r\n         'problems';'related';'search';'solution';'solutions';'solve';'that';'the';'to';...\r\n         'use';'what';'with';'you';'your'};\r\ncount = [3;1;1;1;1;1;1;1;1;3;1;1;1;1;1;1;1;2;1;2;1;1;3;1;1;1;2;1;1;2;3;1;1;2;1;1;1;1;2;1;1;1;1;1];\r\n[words1,count1] = wordscount(txt);\r\nassert(isequal(lower(words1),lower(words))\u0026isequal(count,count1))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":68,"test_suite_updated_at":"2016-12-02T06:03:05.000Z","rescore_all_solutions":false,"group_id":16,"created_at":"2016-11-20T07:04:31.000Z","updated_at":"2026-03-09T20:25:19.000Z","published_at":"2016-11-20T09:01: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\u003eGiven an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\\\\n), arrange the unique words alphabetically in a cell array of character vectors (formerly called\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/help/matlab/matlab_prog/cell-arrays-of-strings.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecell array of strings\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e) and calculate the histogram count of every unique word.\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\u003eAssumptions:\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCase is insensitive, e.g., WORDS and words are treated as the same word, and you may return in the output cell array either the uppercase or lowercase.\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePunctuation marks are limited only to comma (,), period (.), colon (:), semi-colon (;), question mark (?), and exclamation mark (!).\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, given the input txt as a character vector,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[txt = 'I love MATLAB and Cody, but I don''t like trivial matlab problems on cody.';]]\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 outputs should be\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[words = {'and';'but';'Cody';'don''t';'I';'like';'love';'MATLAB';...\\n         'on';'problems';'trivial'};\\ncount = [1; 1; 2; 1; 2; 1; 1; 2; 1; 1; 1];]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: The cell array of strings approach is the dual of the string array approach, i.e., things that can be done via the\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://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estring arrays approach\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e can also be done using the cell array approach.\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\u003eRelated problems in this series:\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:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody/problems/43670-words-count-a-string-array-approach\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWords Count: A String Array Approach\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWords Count: A Cell Array Approach\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:\"r2016b\"","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:\"r2016b\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"r2016b\"","","\"","r2016b","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f49e1b18b68\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f49e1b18ac8\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f49e1b18168\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f49e1b18e88\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f49e1b18de8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f49e1b18d48\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f49e1b18ca8\u003e":"tag:\"r2016b\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f49e1b18ca8\u003e":"tag:\"r2016b\""},"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:\"r2016b\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"r2016b\"","","\"","r2016b","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f49e1b18b68\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f49e1b18ac8\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f49e1b18168\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f49e1b18e88\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f49e1b18de8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f49e1b18d48\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f49e1b18ca8\u003e":"tag:\"r2016b\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f49e1b18ca8\u003e":"tag:\"r2016b\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":43009,"difficulty_rating":"easy"},{"id":43672,"difficulty_rating":"easy"},{"id":43662,"difficulty_rating":"easy"},{"id":43660,"difficulty_rating":"easy-medium"},{"id":43661,"difficulty_rating":"easy-medium"},{"id":43663,"difficulty_rating":"easy-medium"},{"id":43673,"difficulty_rating":"easy-medium"},{"id":43677,"difficulty_rating":"easy-medium"},{"id":43666,"difficulty_rating":"easy-medium"},{"id":43665,"difficulty_rating":"easy-medium"},{"id":43664,"difficulty_rating":"easy-medium"},{"id":43674,"difficulty_rating":"easy-medium"},{"id":43667,"difficulty_rating":"easy-medium"},{"id":43668,"difficulty_rating":"easy-medium"},{"id":43658,"difficulty_rating":"easy-medium"},{"id":43670,"difficulty_rating":"medium"},{"id":43671,"difficulty_rating":"medium"}]}}