{"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":59531,"title":"Create rectangular function.","description":"\r\n\r\nRectangular function - Wikipedia","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 337.581px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 168.788px; transform-origin: 407px 168.791px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 85.7812px; 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 42.8875px; text-align: left; transform-origin: 384px 42.8906px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"https://wikimedia.org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 212.8px; 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 106.4px; text-align: left; transform-origin: 384px 106.4px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Rectangular_function.svg/300px-Rectangular_function.svg.png\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Rectangular_function\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eRectangular function - Wikipedia\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = rect(t,a)\r\n    y=0;\r\nend","test_suite":"%%\r\nt = -1:0.01:1;\r\na = 1;\r\ny_correct(1:50) = 0;\r\ny_correct(51) = 0.5;\r\ny_correct(52:150) = 1;\r\ny_correct(151) = 0.5;\r\ny_correct(152:201) = 0;\r\n\r\nassert(isequal(rect(t,a),y_correct))\r\n\r\n%%\r\nt = -1:0.01:1;\r\na = -1;\r\n\r\ny_correct(1:201) = 0;\r\n\r\nassert(isequal(rect(t,a),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3331474,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":14,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-01-04T14:08:15.000Z","updated_at":"2026-06-04T22:55:57.000Z","published_at":"2024-01-04T14:08:15.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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"80\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"287\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"207\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"300\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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=\\\"https://en.wikipedia.org/wiki/Rectangular_function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eRectangular function - Wikipedia\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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\",\"relationshipId\":\"rId1\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId2\"}]},{\"partUri\":\"/media/image1.org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\",\"contentType\":\"image/org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\",\"content\":\"https://wikimedia.org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\",\"relationship\":null},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Rectangular_function.svg/300px-Rectangular_function.svg.png\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"problems":[{"id":59531,"title":"Create rectangular function.","description":"\r\n\r\nRectangular function - Wikipedia","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 337.581px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 168.788px; transform-origin: 407px 168.791px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 85.7812px; 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 42.8875px; text-align: left; transform-origin: 384px 42.8906px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"https://wikimedia.org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 212.8px; 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 106.4px; text-align: left; transform-origin: 384px 106.4px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Rectangular_function.svg/300px-Rectangular_function.svg.png\" data-image-state=\"image-loaded\"\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Rectangular_function\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eRectangular function - Wikipedia\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = rect(t,a)\r\n    y=0;\r\nend","test_suite":"%%\r\nt = -1:0.01:1;\r\na = 1;\r\ny_correct(1:50) = 0;\r\ny_correct(51) = 0.5;\r\ny_correct(52:150) = 1;\r\ny_correct(151) = 0.5;\r\ny_correct(152:201) = 0;\r\n\r\nassert(isequal(rect(t,a),y_correct))\r\n\r\n%%\r\nt = -1:0.01:1;\r\na = -1;\r\n\r\ny_correct(1:201) = 0;\r\n\r\nassert(isequal(rect(t,a),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3331474,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":14,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2024-01-04T14:08:15.000Z","updated_at":"2026-06-04T22:55:57.000Z","published_at":"2024-01-04T14:08:15.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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"80\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"287\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"207\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"300\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId2\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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=\\\"https://en.wikipedia.org/wiki/Rectangular_function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eRectangular function - Wikipedia\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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\",\"relationshipId\":\"rId1\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId2\"}]},{\"partUri\":\"/media/image1.org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\",\"contentType\":\"image/org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\",\"content\":\"https://wikimedia.org/api/rest_v1/media/math/render/svg/c599ba4136e71e4f1a6703ee97f98d0fb2b3aaec\",\"relationship\":null},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Rectangular_function.svg/300px-Rectangular_function.svg.png\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"errors":[],"facets":[[],[{"value":"easy","count":1,"selected":false}]],"term":"tag:\"rectangular function\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}