{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-06-05T00:10:21.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-06-05T00: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":44283,"title":"Calories in a slice of pizza?","description":"The total calories C in a pizza is printed on its box. You know the angle A (degrees) of the slice you placed on your plate. Please estimate  calories E in this slice.","description_html":"\u003cp\u003eThe total calories C in a pizza is printed on its box. You know the angle A (degrees) of the slice you placed on your plate. Please estimate  calories E in this slice.\u003c/p\u003e","function_template":"function e = pizza(a,c)\r\n  e=a/c;\r\nend","test_suite":"%%\r\na = 60;\r\nc = 3000;\r\nassert(pizza(a,c)\u003e450)\r\n\r\n%%\r\na = 30;\r\nc = 3000;\r\nassert(pizza(a,c)\u003c260)\r\n\r\n%%\r\na = 15;\r\nc = 6000;\r\nassert(pizza(a,c)\u003e240)\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":114,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-08-10T12:11:07.000Z","updated_at":"2026-05-05T18:29:44.000Z","published_at":"2017-08-10T12:11:27.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe total calories C in a pizza is printed on its box. You know the angle A (degrees) of the slice you placed on your plate. Please estimate calories E in this slice.\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":2902,"title":"What's for Lunch?","description":"Given b choices of beverages, e choices of entrees, s choices of sides (take two different sides total) and d choices of desserts, how many different meal combinations are possible?","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: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 21px; transform-origin: 407px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 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: 373px 8px; transform-origin: 373px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven b choices of beverages, e choices of entrees, s choices of sides (take two different sides total) and d choices of desserts, how many different meal combinations are possible?\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = lunch(b,e,s,d)\r\n  y = x;\r\nend","test_suite":"%%\r\nb = 18;\r\ne = 7;\r\ns = 9;\r\nd = 24;\r\ny_correct = 217728;\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nb = 2;\r\nd = 3;\r\ns = 10;\r\ne = 4;\r\ny_correct = 2160;\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nb = 1;\r\nd = 2;\r\ns = 11;\r\ne = 3;\r\ny_correct = 660;\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nb = 5;\r\nd = 2;\r\ns = 9;\r\ne = 100;\r\ny_correct = 72000;\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nr = randi(10);\r\nb = r;\r\nd = 1;\r\ns = 5;\r\ne = 1;\r\ny_correct = r*nchoosek(s,2)*(d+e);\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nb = 5;\r\nd = 7;\r\ns = 2;\r\ne = 3;\r\ny_correct = 210;\r\nassert(isequal(lunch(b,e,s,d),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":4,"created_by":33786,"edited_by":223089,"edited_at":"2023-02-03T18:05:26.000Z","deleted_by":null,"deleted_at":null,"solvers_count":65,"test_suite_updated_at":"2023-02-03T18:05:26.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-30T01:30:11.000Z","updated_at":"2026-04-07T08:40:13.000Z","published_at":"2015-01-30T01:30:11.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven b choices of beverages, e choices of entrees, s choices of sides (take two different sides total) and d choices of desserts, how many different meal combinations are possible?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"problems":[{"id":44283,"title":"Calories in a slice of pizza?","description":"The total calories C in a pizza is printed on its box. You know the angle A (degrees) of the slice you placed on your plate. Please estimate  calories E in this slice.","description_html":"\u003cp\u003eThe total calories C in a pizza is printed on its box. You know the angle A (degrees) of the slice you placed on your plate. Please estimate  calories E in this slice.\u003c/p\u003e","function_template":"function e = pizza(a,c)\r\n  e=a/c;\r\nend","test_suite":"%%\r\na = 60;\r\nc = 3000;\r\nassert(pizza(a,c)\u003e450)\r\n\r\n%%\r\na = 30;\r\nc = 3000;\r\nassert(pizza(a,c)\u003c260)\r\n\r\n%%\r\na = 15;\r\nc = 6000;\r\nassert(pizza(a,c)\u003e240)\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":114,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-08-10T12:11:07.000Z","updated_at":"2026-05-05T18:29:44.000Z","published_at":"2017-08-10T12:11:27.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe total calories C in a pizza is printed on its box. You know the angle A (degrees) of the slice you placed on your plate. Please estimate calories E in this slice.\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":2902,"title":"What's for Lunch?","description":"Given b choices of beverages, e choices of entrees, s choices of sides (take two different sides total) and d choices of desserts, how many different meal combinations are possible?","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: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 21px; transform-origin: 407px 21px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 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: 373px 8px; transform-origin: 373px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven b choices of beverages, e choices of entrees, s choices of sides (take two different sides total) and d choices of desserts, how many different meal combinations are possible?\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = lunch(b,e,s,d)\r\n  y = x;\r\nend","test_suite":"%%\r\nb = 18;\r\ne = 7;\r\ns = 9;\r\nd = 24;\r\ny_correct = 217728;\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nb = 2;\r\nd = 3;\r\ns = 10;\r\ne = 4;\r\ny_correct = 2160;\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nb = 1;\r\nd = 2;\r\ns = 11;\r\ne = 3;\r\ny_correct = 660;\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nb = 5;\r\nd = 2;\r\ns = 9;\r\ne = 100;\r\ny_correct = 72000;\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nr = randi(10);\r\nb = r;\r\nd = 1;\r\ns = 5;\r\ne = 1;\r\ny_correct = r*nchoosek(s,2)*(d+e);\r\nassert(isequal(lunch(b,e,s,d),y_correct))\r\n\r\n%%\r\nb = 5;\r\nd = 7;\r\ns = 2;\r\ne = 3;\r\ny_correct = 210;\r\nassert(isequal(lunch(b,e,s,d),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":4,"created_by":33786,"edited_by":223089,"edited_at":"2023-02-03T18:05:26.000Z","deleted_by":null,"deleted_at":null,"solvers_count":65,"test_suite_updated_at":"2023-02-03T18:05:26.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-30T01:30:11.000Z","updated_at":"2026-04-07T08:40:13.000Z","published_at":"2015-01-30T01:30:11.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven b choices of beverages, e choices of entrees, s choices of sides (take two different sides total) and d choices of desserts, how many different meal combinations are possible?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"errors":[],"facets":[[],[{"value":"easy","count":2,"selected":false}]],"term":"tag:\"lunch\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}