{"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":3004,"title":"Two functions (to be sure)","description":"I want to compute the number of odd/even  numbers in an array. But I want the results by two different functions.\r\n\r\nExample:\r\n\r\n x=1:10;\r\n assert(isequal(odd_fcn(x),5))\r\n assert(isequal(even_fcn(x),5))\r\n\r\nSo you must solve this problem by writing 2 functions.\r\n\r\nBut you can only submit one function at the time.\r\n\r\nDo you think it's possible? \r\n\r\nHINT: I always test odd_fcn first. So odd_fcn must create the other function...","description_html":"\u003cp\u003eI want to compute the number of odd/even  numbers in an array. But I want the results by two different functions.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e x=1:10;\r\n assert(isequal(odd_fcn(x),5))\r\n assert(isequal(even_fcn(x),5))\u003c/pre\u003e\u003cp\u003eSo you must solve this problem by writing 2 functions.\u003c/p\u003e\u003cp\u003eBut you can only submit one function at the time.\u003c/p\u003e\u003cp\u003eDo you think it's possible?\u003c/p\u003e\u003cp\u003eHINT: I always test odd_fcn first. So odd_fcn must create the other function...\u003c/p\u003e","function_template":"function y = odd_fcn(x)\r\n  ???\r\nend","test_suite":"%%\r\nx = 1;\r\nassert(isequal(odd_fcn(x),1))\r\nassert(isequal(even_fcn(x),0))\r\n%%\r\ny = 2;\r\nassert(isequal(odd_fcn(y),0))\r\nassert(isequal(even_fcn(y),1))\r\n%%\r\nx = [1 2];\r\nassert(isequal(odd_fcn(x),1))\r\nassert(isequal(even_fcn(x),1))\r\n%%\r\nx = 1:10;\r\nassert(isequal(odd_fcn(x),5))\r\nassert(isequal(even_fcn(x),5))\r\n%%\r\nx = 1:100;\r\nassert(isequal(odd_fcn(x),50))\r\nassert(isequal(even_fcn(x),50))\r\n%%\r\nx=(2:2:1000)';\r\nassert(isequal(odd_fcn(x),0))\r\nassert(isequal(even_fcn(x),500))\r\n%%\r\nx = [1:2:10000];\r\nassert(isequal(odd_fcn(x),5000))\r\nassert(isequal(even_fcn(x),0))\r\n%%\r\nx = [2 1:2:10000];\r\nassert(isequal(odd_fcn(x),5000))\r\nassert(isequal(even_fcn(x),1))\r\n%%\r\nx = [1 2 3;4 5 6;7 8 9];\r\nassert(isequal(odd_fcn(x),5))\r\nassert(isequal(even_fcn(x),4))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":"2015-02-11T16:15:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-11T16:06:45.000Z","updated_at":"2026-03-24T07:21:54.000Z","published_at":"2015-02-11T16:15:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI want to compute the number of odd/even numbers in an array. But I want the results by two different functions.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x=1:10;\\n assert(isequal(odd_fcn(x),5))\\n assert(isequal(even_fcn(x),5))]]\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\u003eSo you must solve this problem by writing 2 functions.\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\u003eBut you can only submit one function at the time.\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\u003eDo you think it's possible?\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: I always test odd_fcn first. So odd_fcn must create the other function...\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":45976,"title":"Evaluate the Struve function","description":"The \u003chttps://en.wikipedia.org/wiki/Struve_function Struve function\u003e *H*_a(x) is a solution to an inhomogeneous form of Bessel's equation:\r\n\r\n\u003c\u003chttps://wikimedia.org/api/rest_v1/media/math/render/svg/246a7bab900d24f188a7edcec59042852728d747\u003e\u003e\r\n\r\nThe Struve function appears in applications of optics and loudspeaker design. I encountered it in developing a model of turbulence in a strongly stratified fluid (e.g., a lake with a large temperature difference). \r\n\r\nEvaluate the Struve function *H*_p(x) for given values of the order p and argument x. ","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: 151.583px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 75.7917px; transform-origin: 407px 75.7917px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9083px; text-align: left; transform-origin: 384px 10.9083px; 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: 12.0583px 7.79167px; transform-origin: 12.0583px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Struve_function\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eStruve function\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAACpElEQVRoge1ZUZWDMBAcDzjAAAZQgAIc1EEd1EI1IOE8YKEasND72MxryIVANoHL3cu8x0+7JNnJbnayABUVFRUVfxWteXKgyTFWC+B+4BmNfR9pnxMdgC+I4znQAJiQuNYGwABZ2NvzzGaCzti3xn7asF8A3Cz7XMhNng36mAwfISEiXh77IcdCHLSQjcm9KUQD8SV5fF8Uxtr3qYvwYIYcC2digJCYFOElEjhCou+M1HXxBeCROkBpBL5wfvQRI8QHdWUujcBkhxRYkLBhpRE4QSLwSiTNWRqBbwDPyHdaSOTe8TNyqXlDkuWOhKgvicDejHc0nahN7TVN1v8j1uvcIojzquSYj5DQbcOnA3MRSIc1jtAPVu8estYBEtHT9qvRG+edOOXJRSBTSTPezVnPK2KcxrynkjMlpXAKgZ21ngXx17Q3xLdo/BcCASHuDV1FrQTi0+yYFe9qqj+AsgjkOaYZr4EQt1dxfcheRGLtc8uYm+LdJ9YExpyBnFfV3iqJQG01HPHpqvAcjElHRr6qtXUFgdRlbKf3gcXOiDvMO6z7ejwHWUiY2qGUfkKIV4E7dkSxA+s02SOwN4ujtHhAHKSTvkhjNGy1stiSn4ztgrXwtvXgiGOd5wWRBYQt/a0WfWxL/+XY2+D5suBDdGP95ru7hs4jjsfHPS/bnf+3xotK3ys/KlGauNEWinYWhC2wcRCK/ND/7lwq/XcVmPL2DjNKtgQvi8EZ31ps8PZyZe8xCkxVN5p4ToWqbZbvFTuYoZNMl2HAT6L4NWyv2gPiXKiLkoIHlDePK8EKPHh+O6odb8jv6HjCmKeAkdZBIo96K1awDsgn1lsUnraEXShYpc/4fvxvcaRQVARA0V2jTgH7Ul+sxioZ7g2lklhRUfGb+AZo751xkRPZLgAAAABJRU5ErkJggg==\" alt=\"H_p(x)\" style=\"width: 40px; height: 20px;\" width=\"40\" height=\"20\"\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: 190.383px 7.79167px; transform-origin: 190.383px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a solution to an inhomogeneous form of Bessel's equation:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 38.95px; 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 19.475px; text-align: left; transform-origin: 384px 19.475px; 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: 15.5333px 7.79167px; transform-origin: 15.5333px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e        \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-17px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAh8AAABOCAYAAACAEHSqAAAVKklEQVR4nO2dy20zPZOFTw7KQNtZKAFF4AiUgYBZ/1AE4xQUwT+AMxjvZ+kUHMEsnMI3i/ZBl2jeyb6fB2i8eK1Lq9ls8rCqWAUIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCiCU5/x5iRi4A7gAeAG4L/xYhhBBiLk4A3gH8A+Bt4d9yKJ4AfgB8Ymj8fwB8YRAkQgghjsMNwMfSP2JGuOj+gcTHrDzw2tFOGITHPxjEiBBCiPm5YVgYzs0XhnmhF++dvy+H6+85TwWf4eJb4mNirr//fuGvj+uC0QJScvNEPvIrCnEMThjG25KxdCnhccYw7qfGpzOGa8q9rgfmvZ4HyucviY8JOGHozLRyWGUbamiJj75cMKrxJxRXI8RRoCU51419+/3MEjwS534D8I1xfuDxibRgeWI+C4jEx0qg8v7A2Fmu0U+McR+iHYoO+hQl6oQ4BpwEc8XHBcM4sVS83TeGGAgfDMgMHT+IC5DT73tScw8wWn6+MYiCx++/P8iLR5T4WBm8IT+I35Tr7/tCnVDUwc4tUSfE/uE4WiI+PrGMuwUY3e2+uYHX8sQoMGhRt5aQ1NjG9+e6ajhfURDckBePKPGxMmj5SEUyP6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YFSeEE0valOpHX3W31PppPa+EhxBCiF1id3uc8ZqfhLtBjprDqSX/SwtvC5xTCCGEWIQzxmBP9zgitenUhRBCCCGquEGuDyGEEEIIIYQQQgghhBBCiKPx/2Ec84wu4SWMAAAAAElFTkSuQmCC\" alt=\"Differential equation from the Wikipedia link\" style=\"width: 271.5px; height: 39px;\" width=\"271.5\" height=\"39\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 370.333px 7.79167px; transform-origin: 370.333px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe Struve function appears in applications of optics and loudspeaker design. I encountered it in developing a model of turbulence in a strongly stratified fluid (e.g., a lake with a large temperature difference).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9083px; text-align: left; transform-origin: 384px 10.9083px; 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: 87.5167px 7.79167px; transform-origin: 87.5167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEvaluate the Struve function\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAACpElEQVRoge1ZUZWDMBAcDzjAAAZQgAIc1EEd1EI1IOE8YKEasND72MxryIVANoHL3cu8x0+7JNnJbnayABUVFRUVfxWteXKgyTFWC+B+4BmNfR9pnxMdgC+I4znQAJiQuNYGwABZ2NvzzGaCzti3xn7asF8A3Cz7XMhNng36mAwfISEiXh77IcdCHLSQjcm9KUQD8SV5fF8Uxtr3qYvwYIYcC2digJCYFOElEjhCou+M1HXxBeCROkBpBL5wfvQRI8QHdWUujcBkhxRYkLBhpRE4QSLwSiTNWRqBbwDPyHdaSOTe8TNyqXlDkuWOhKgvicDejHc0nahN7TVN1v8j1uvcIojzquSYj5DQbcOnA3MRSIc1jtAPVu8estYBEtHT9qvRG+edOOXJRSBTSTPezVnPK2KcxrynkjMlpXAKgZ21ngXx17Q3xLdo/BcCASHuDV1FrQTi0+yYFe9qqj+AsgjkOaYZr4EQt1dxfcheRGLtc8uYm+LdJ9YExpyBnFfV3iqJQG01HPHpqvAcjElHRr6qtXUFgdRlbKf3gcXOiDvMO6z7ejwHWUiY2qGUfkKIV4E7dkSxA+s02SOwN4ujtHhAHKSTvkhjNGy1stiSn4ztgrXwtvXgiGOd5wWRBYQt/a0WfWxL/+XY2+D5suBDdGP95ru7hs4jjsfHPS/bnf+3xotK3ys/KlGauNEWinYWhC2wcRCK/ND/7lwq/XcVmPL2DjNKtgQvi8EZ31ps8PZyZe8xCkxVN5p4ToWqbZbvFTuYoZNMl2HAT6L4NWyv2gPiXKiLkoIHlDePK8EKPHh+O6odb8jv6HjCmKeAkdZBIo96K1awDsgn1lsUnraEXShYpc/4fvxvcaRQVARA0V2jTgH7Ul+sxioZ7g2lklhRUfGb+AZo751xkRPZLgAAAABJRU5ErkJggg==\" alt=\"H_p(x)\" style=\"width: 40px; height: 20px;\" width=\"40\" height=\"20\"\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: 90.625px 7.79167px; transform-origin: 90.625px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e for given values of the order \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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: 47.0667px 7.79167px; transform-origin: 47.0667px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and argument \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ex\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Hp = StruveFn(p,x)\r\n  Hp = f(x,p);\r\nend","test_suite":"%%\r\nx = 0;\r\np = randi(8,1);\r\nHp_correct = 0;\r\nassert(isequal(StruveFn(p,x),Hp_correct))\r\n\r\n%%\r\nx = 0.4;\r\np = 0;\r\nHp_correct = 0.2501497138634162;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = 10;\r\np = 0;\r\nHp_correct = 0.1187436836875042;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = rand(1);\r\np = 1/2;\r\nHp_correct = sqrt(2/(pi*x))*(1-cos(x));\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = 4.2;\r\np = 1;\r\nHp_correct = 1.036818631956923;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = pi^2;\r\np = 3;\r\nHp_correct = 4.10841348624688;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%%\r\nx = rand(1);\r\np = 1;\r\nHp_approx = 2/pi - besselj(0,x) + (16/pi-5)*sin(x)/x + (12-36/pi)*(1-cos(x))/x^2;\r\nassert(abs(StruveFn(p,x)-Hp_approx)/Hp_approx\u003c0.002)","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":"2021-01-02T18:43:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-21T16:48:35.000Z","updated_at":"2026-01-09T13:52:55.000Z","published_at":"2020-06-21T17:11: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: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=\\\"https://en.wikipedia.org/wiki/Struve_function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eStruve function\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\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"H_p(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\bf H}_p(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is a solution to an inhomogeneous form of Bessel's equation:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e        \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"Differential equation from the Wikipedia link\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex^2\\\\frac{d^2y}{dx^2}+x\\\\frac{dy}{dx}+(x^2-p^2)y=\\\\frac{4(x/2)^{p+1}}{\\\\sqrt{\\\\pi}\\\\Gamma(p+1/2)}\u003c/w:t\u003e\u003c/w:r\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:r\u003e\u003cw:t\u003eThe Struve function appears in applications of optics and loudspeaker design. I encountered it in developing a model of turbulence in a strongly stratified fluid (e.g., a lake with a large temperature difference).\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\u003eEvaluate the Struve function\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"H_p(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\bf H}_p(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e for given values of the order \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"p\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and argument \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":3031,"title":"Expression or variable?","description":"Test if arguments of the function are all variables (workspace variables names). \r\nReturn 1 if yes, 0 if no.\r\n\r\nFor example : \r\n\r\n\r\na=1;\r\n\r\nb=2;\r\n\r\nc=3;\r\n\r\n* are_variables(a,b)    -\u003e 1\r\n* \r\n* are_variables(a,b,1)  -\u003e 0       \r\n\r\n\r\nEasy ?","description_html":"\u003cp\u003eTest if arguments of the function are all variables (workspace variables names). \r\nReturn 1 if yes, 0 if no.\u003c/p\u003e\u003cp\u003eFor example :\u003c/p\u003e\u003cp\u003ea=1;\u003c/p\u003e\u003cp\u003eb=2;\u003c/p\u003e\u003cp\u003ec=3;\u003c/p\u003e\u003cul\u003e\u003cli\u003eare_variables(a,b)    -\u0026gt; 1\u003c/li\u003e\u003cli\u003e\u003c/li\u003e\u003cli\u003eare_variables(a,b,1)  -\u0026gt; 0\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eEasy ?\u003c/p\u003e","function_template":"function y = are_variables(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\nassert(isequal(are_variables(x),1))\r\n%%\r\nx = 1;\r\nassert(isequal(are_variables(1),0))\r\n%%\r\nx = 1;\r\nassert(isequal(are_variables('x'),0))\r\n%%\r\nassert(isequal(are_variables('x',1,2),0))\r\n%%\r\na = 1;\r\nb=0;\r\nassert(isequal(are_variables(a,b),1))\r\n%%\r\nassert(isequal(are_variables(1,2,3,4,5),0))\r\n%%\r\na = 1;\r\nassert(isequal(are_variables(a,a,a),1))\r\n%%\r\na = 1;\r\nb=0;\r\nc=ones(5);\r\nassert(isequal(are_variables(a,'a'),0))\r\n%%\r\nx = 1;\r\ny=0;\r\nzz=ones(5);\r\nassert(isequal(are_variables(zz,'a'),0))\r\n%%\r\nx = 1;\r\ny=0;\r\nz=ones(5);\r\nassert(isequal(are_variables(x,y,z),1))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":"2015-02-20T11:18:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-20T11:17:48.000Z","updated_at":"2026-01-13T16:04:55.000Z","published_at":"2015-02-20T11:18:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eTest if arguments of the function are all variables (workspace variables names). Return 1 if yes, 0 if no.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example :\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ea=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:r\u003e\u003cw:t\u003eb=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:r\u003e\u003cw:t\u003ec=3;\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\u003eare_variables(a,b) -\u0026gt; 1\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\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\u003eare_variables(a,b,1) -\u0026gt; 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:t\u003eEasy ?\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":651,"title":"Functional inputs","description":"Return an n-dimensional array whose elements are the results of a function over a set of vectors.\r\n\r\nThe (i,j,k, ...n)th element of the output matrix is the results of executing the function on the ith element of the first vector, jth element of the second, and so forth. The function will be passed in, accepts n arguments, and returns a single number.\r\n\r\nFor example, if the function is:\r\n\r\n    minus12 = @(a) a(1)-a(2);\r\n\r\nand the inputs are:\r\n\r\n    as = [1 3 5 7];\r\n    bs = [0 1 2 3 4];\r\n\r\nthen the output would be:\r\n\r\n    \u003e\u003e gridit(minus12, as, bs)\r\n    ans =\r\n           1  0 -1 -2 -3\r\n           3  2  1  0 -1\r\n           5  4  3  2  1\r\n           7  6  5  4  3\r\n","description_html":"\u003cp\u003eReturn an n-dimensional array whose elements are the results of a function over a set of vectors.\u003c/p\u003e\u003cp\u003eThe (i,j,k, ...n)th element of the output matrix is the results of executing the function on the ith element of the first vector, jth element of the second, and so forth. The function will be passed in, accepts n arguments, and returns a single number.\u003c/p\u003e\u003cp\u003eFor example, if the function is:\u003c/p\u003e\u003cpre\u003e    minus12 = @(a) a(1)-a(2);\u003c/pre\u003e\u003cp\u003eand the inputs are:\u003c/p\u003e\u003cpre\u003e    as = [1 3 5 7];\r\n    bs = [0 1 2 3 4];\u003c/pre\u003e\u003cp\u003ethen the output would be:\u003c/p\u003e\u003cpre\u003e    \u003e\u003e gridit(minus12, as, bs)\r\n    ans =\r\n           1  0 -1 -2 -3\r\n           3  2  1  0 -1\r\n           5  4  3  2  1\r\n           7  6  5  4  3\u003c/pre\u003e","function_template":"function out = gridit(fn, varargin)\r\n  out = [];\r\nend\r\n","test_suite":"%%\r\nx1 = [ 1 2 3 ];\r\nx2 = [ 10 20 ];\r\ny_correct = [11 21; 12 22; 13 23];\r\nassert(isequal(gridit(@sum, x1, x2), y_correct));\r\n\r\n%%\r\nx1 = [ 1 2 3 ];\r\nx2 = [ 10 20 ];\r\nx3 = [ 0 100 ];\r\ny_correct(:,:,1) = [11 21; 12 22; 13 23];\r\ny_correct(:,:,2) = y_correct(:,:,1) + 100;\r\nassert(isequal(gridit(@sum, x1, x2, x3), y_correct));\r\n\r\n%%\r\nassert(isequal(gridit(@sum, 2,3),5));","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":78,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-05-02T15:44:58.000Z","updated_at":"2026-01-23T15:32:17.000Z","published_at":"2012-05-02T15:44:58.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\u003eReturn an n-dimensional array whose elements are the results of a function over a set of vectors.\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 (i,j,k, ...n)th element of the output matrix is the results of executing the function on the ith element of the first vector, jth element of the second, and so forth. The function will be passed in, accepts n arguments, and returns a single number.\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 function is:\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[    minus12 = @(a) a(1)-a(2);]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand 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[    as = [1 3 5 7];\\n    bs = [0 1 2 3 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:t\u003ethen the output would 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[    \u003e\u003e gridit(minus12, as, bs)\\n    ans =\\n           1  0 -1 -2 -3\\n           3  2  1  0 -1\\n           5  4  3  2  1\\n           7  6  5  4  3]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42618,"title":"Is this function available?","description":"Sometimes it is difficult to remember which functions are not allowed on the Cody platform. Given a function as a string, return true if it is available on Cody and false otherwise.\r\n\r\nThe test suite will be updated periodically, so hard-coding the answers will eventually fail.\r\n\r\n*Examples*\r\n\r\n  isavailable('bsxfun') returns true\r\n\r\n  isavailable('pdist2') returns false","description_html":"\u003cp\u003eSometimes it is difficult to remember which functions are not allowed on the Cody platform. Given a function as a string, return true if it is available on Cody and false otherwise.\u003c/p\u003e\u003cp\u003eThe test suite will be updated periodically, so hard-coding the answers will eventually fail.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eisavailable('bsxfun') returns true\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eisavailable('pdist2') returns false\r\n\u003c/pre\u003e","function_template":"function tf = isavailable(f)\r\n  tf = true;\r\nend","test_suite":"%%\r\nassert(isequal(isavailable('sum'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('mean'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('bsxfun'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('pdist'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('hankel'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('std'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('evalin'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('toeplitz'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('pdist2'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('assignin'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('cell2mat'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('arrayfun'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('cellstr'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('imfindcircles'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('imread'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('plot'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('ocr'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('cellfun'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('dec2bin'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('eval'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('randi'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('rng'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('fread'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('houghlines'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('kron'),true))","published":true,"deleted":false,"likes_count":1,"comments_count":10,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":"2015-09-18T20:36:50.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-09-18T20:33:30.000Z","updated_at":"2026-03-13T12:52:05.000Z","published_at":"2015-09-18T20:33:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSometimes it is difficult to remember which functions are not allowed on the Cody platform. Given a function as a string, return true if it is available on Cody and false otherwise.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe test suite will be updated periodically, so hard-coding the answers will eventually fail.\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\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[isavailable('bsxfun') returns true\\n\\nisavailable('pdist2') returns false]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":3004,"title":"Two functions (to be sure)","description":"I want to compute the number of odd/even  numbers in an array. But I want the results by two different functions.\r\n\r\nExample:\r\n\r\n x=1:10;\r\n assert(isequal(odd_fcn(x),5))\r\n assert(isequal(even_fcn(x),5))\r\n\r\nSo you must solve this problem by writing 2 functions.\r\n\r\nBut you can only submit one function at the time.\r\n\r\nDo you think it's possible? \r\n\r\nHINT: I always test odd_fcn first. So odd_fcn must create the other function...","description_html":"\u003cp\u003eI want to compute the number of odd/even  numbers in an array. But I want the results by two different functions.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e x=1:10;\r\n assert(isequal(odd_fcn(x),5))\r\n assert(isequal(even_fcn(x),5))\u003c/pre\u003e\u003cp\u003eSo you must solve this problem by writing 2 functions.\u003c/p\u003e\u003cp\u003eBut you can only submit one function at the time.\u003c/p\u003e\u003cp\u003eDo you think it's possible?\u003c/p\u003e\u003cp\u003eHINT: I always test odd_fcn first. So odd_fcn must create the other function...\u003c/p\u003e","function_template":"function y = odd_fcn(x)\r\n  ???\r\nend","test_suite":"%%\r\nx = 1;\r\nassert(isequal(odd_fcn(x),1))\r\nassert(isequal(even_fcn(x),0))\r\n%%\r\ny = 2;\r\nassert(isequal(odd_fcn(y),0))\r\nassert(isequal(even_fcn(y),1))\r\n%%\r\nx = [1 2];\r\nassert(isequal(odd_fcn(x),1))\r\nassert(isequal(even_fcn(x),1))\r\n%%\r\nx = 1:10;\r\nassert(isequal(odd_fcn(x),5))\r\nassert(isequal(even_fcn(x),5))\r\n%%\r\nx = 1:100;\r\nassert(isequal(odd_fcn(x),50))\r\nassert(isequal(even_fcn(x),50))\r\n%%\r\nx=(2:2:1000)';\r\nassert(isequal(odd_fcn(x),0))\r\nassert(isequal(even_fcn(x),500))\r\n%%\r\nx = [1:2:10000];\r\nassert(isequal(odd_fcn(x),5000))\r\nassert(isequal(even_fcn(x),0))\r\n%%\r\nx = [2 1:2:10000];\r\nassert(isequal(odd_fcn(x),5000))\r\nassert(isequal(even_fcn(x),1))\r\n%%\r\nx = [1 2 3;4 5 6;7 8 9];\r\nassert(isequal(odd_fcn(x),5))\r\nassert(isequal(even_fcn(x),4))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":"2015-02-11T16:15:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-11T16:06:45.000Z","updated_at":"2026-03-24T07:21:54.000Z","published_at":"2015-02-11T16:15:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eI want to compute the number of odd/even numbers in an array. But I want the results by two different functions.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x=1:10;\\n assert(isequal(odd_fcn(x),5))\\n assert(isequal(even_fcn(x),5))]]\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\u003eSo you must solve this problem by writing 2 functions.\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\u003eBut you can only submit one function at the time.\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\u003eDo you think it's possible?\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: I always test odd_fcn first. So odd_fcn must create the other function...\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":45976,"title":"Evaluate the Struve function","description":"The \u003chttps://en.wikipedia.org/wiki/Struve_function Struve function\u003e *H*_a(x) is a solution to an inhomogeneous form of Bessel's equation:\r\n\r\n\u003c\u003chttps://wikimedia.org/api/rest_v1/media/math/render/svg/246a7bab900d24f188a7edcec59042852728d747\u003e\u003e\r\n\r\nThe Struve function appears in applications of optics and loudspeaker design. I encountered it in developing a model of turbulence in a strongly stratified fluid (e.g., a lake with a large temperature difference). \r\n\r\nEvaluate the Struve function *H*_p(x) for given values of the order p and argument x. ","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: 151.583px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 75.7917px; transform-origin: 407px 75.7917px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9083px; text-align: left; transform-origin: 384px 10.9083px; 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: 12.0583px 7.79167px; transform-origin: 12.0583px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Struve_function\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eStruve function\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAACpElEQVRoge1ZUZWDMBAcDzjAAAZQgAIc1EEd1EI1IOE8YKEasND72MxryIVANoHL3cu8x0+7JNnJbnayABUVFRUVfxWteXKgyTFWC+B+4BmNfR9pnxMdgC+I4znQAJiQuNYGwABZ2NvzzGaCzti3xn7asF8A3Cz7XMhNng36mAwfISEiXh77IcdCHLSQjcm9KUQD8SV5fF8Uxtr3qYvwYIYcC2digJCYFOElEjhCou+M1HXxBeCROkBpBL5wfvQRI8QHdWUujcBkhxRYkLBhpRE4QSLwSiTNWRqBbwDPyHdaSOTe8TNyqXlDkuWOhKgvicDejHc0nahN7TVN1v8j1uvcIojzquSYj5DQbcOnA3MRSIc1jtAPVu8estYBEtHT9qvRG+edOOXJRSBTSTPezVnPK2KcxrynkjMlpXAKgZ21ngXx17Q3xLdo/BcCASHuDV1FrQTi0+yYFe9qqj+AsgjkOaYZr4EQt1dxfcheRGLtc8uYm+LdJ9YExpyBnFfV3iqJQG01HPHpqvAcjElHRr6qtXUFgdRlbKf3gcXOiDvMO6z7ejwHWUiY2qGUfkKIV4E7dkSxA+s02SOwN4ujtHhAHKSTvkhjNGy1stiSn4ztgrXwtvXgiGOd5wWRBYQt/a0WfWxL/+XY2+D5suBDdGP95ru7hs4jjsfHPS/bnf+3xotK3ys/KlGauNEWinYWhC2wcRCK/ND/7lwq/XcVmPL2DjNKtgQvi8EZ31ps8PZyZe8xCkxVN5p4ToWqbZbvFTuYoZNMl2HAT6L4NWyv2gPiXKiLkoIHlDePK8EKPHh+O6odb8jv6HjCmKeAkdZBIo96K1awDsgn1lsUnraEXShYpc/4fvxvcaRQVARA0V2jTgH7Ul+sxioZ7g2lklhRUfGb+AZo751xkRPZLgAAAABJRU5ErkJggg==\" alt=\"H_p(x)\" style=\"width: 40px; height: 20px;\" width=\"40\" height=\"20\"\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: 190.383px 7.79167px; transform-origin: 190.383px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e is a solution to an inhomogeneous form of Bessel's equation:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 38.95px; 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 19.475px; text-align: left; transform-origin: 384px 19.475px; 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: 15.5333px 7.79167px; transform-origin: 15.5333px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e        \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-17px\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Laby3lttSyZOO+akXC49irSRtYqPWDr1GK3CAxjv3yYs3XzAbGIxJtqxHZomf5/Zn3vdH/ibr8K6AXhTtO125Iwx38kNfyPvmYzNQnNkaAD0pbAXQpRht47yuWyxetiFA62Vl8DfSoVIL/FRs1vCWjV8Y3tt3GCKtYqPWgGRkyn3jrjn4QN9Bd6kWDO99cmxror9u69hbKf3JSi7JV4XQog1YuMU7ub/NWMYK8i6MQ/ubkPWeCrdJdFLfPAaS8QPUzGEitTFSke0sEbxUboLilDUxoQF3egxvrGxOl5U2g/87fQ3DJ0m1JgnjCv30HtC5d6FEGLNcGKlJbjG6uHu2rBj7AN/F38157DxY61ubWYmzYXiwhc4/4W6XRs5TC0+alxFd5S3v82j9Rk4QkVHLZeM9wghhNgAbgxVjdXDplP3ua1dq3PJrkK6WF0Bw6KgNQs+WmNyPmt/Py3mLBj6g0HITLXonEp8nPG3TR/Iuy/cLJCLTemfOlI7Thn2IIQQYge0li1gXFfIlUIBUbpi5SQZO2on5m/kxS24u+toBX/D9PVFphAfqYJ/MXdYaTr1nPuXe25gtM4JIYTYAQwU3UTK6k5wJ17KatGj+Fot199jLUXU3rFcvEVpNWYhhBAb4Ig79HIm0x5BrnvBpkmYEwb1HrGPCiGE2CFMZugjJ6X6UWhNp96CEkkKIYTYFSeEE0valOpHX3W31PppPa+EhxBCiF1id3uc8ZqfhLtBjprDqSX/SwtvC5xTCCGEWIQzxmBP9zgitenUhRBCCCGquEGuDyGEEEIIIYQQQgghhBBCiKPx/2Ec84wu4SWMAAAAAElFTkSuQmCC\" alt=\"Differential equation from the Wikipedia link\" style=\"width: 271.5px; height: 39px;\" width=\"271.5\" height=\"39\"\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 370.333px 7.79167px; transform-origin: 370.333px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe Struve function appears in applications of optics and loudspeaker design. I encountered it in developing a model of turbulence in a strongly stratified fluid (e.g., a lake with a large temperature difference).\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21.8167px; 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.9083px; text-align: left; transform-origin: 384px 10.9083px; 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: 87.5167px 7.79167px; transform-origin: 87.5167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eEvaluate the Struve function\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-6px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAYAAABpYH0BAAACpElEQVRoge1ZUZWDMBAcDzjAAAZQgAIc1EEd1EI1IOE8YKEasND72MxryIVANoHL3cu8x0+7JNnJbnayABUVFRUVfxWteXKgyTFWC+B+4BmNfR9pnxMdgC+I4znQAJiQuNYGwABZ2NvzzGaCzti3xn7asF8A3Cz7XMhNng36mAwfISEiXh77IcdCHLSQjcm9KUQD8SV5fF8Uxtr3qYvwYIYcC2digJCYFOElEjhCou+M1HXxBeCROkBpBL5wfvQRI8QHdWUujcBkhxRYkLBhpRE4QSLwSiTNWRqBbwDPyHdaSOTe8TNyqXlDkuWOhKgvicDejHc0nahN7TVN1v8j1uvcIojzquSYj5DQbcOnA3MRSIc1jtAPVu8estYBEtHT9qvRG+edOOXJRSBTSTPezVnPK2KcxrynkjMlpXAKgZ21ngXx17Q3xLdo/BcCASHuDV1FrQTi0+yYFe9qqj+AsgjkOaYZr4EQt1dxfcheRGLtc8uYm+LdJ9YExpyBnFfV3iqJQG01HPHpqvAcjElHRr6qtXUFgdRlbKf3gcXOiDvMO6z7ejwHWUiY2qGUfkKIV4E7dkSxA+s02SOwN4ujtHhAHKSTvkhjNGy1stiSn4ztgrXwtvXgiGOd5wWRBYQt/a0WfWxL/+XY2+D5suBDdGP95ru7hs4jjsfHPS/bnf+3xotK3ys/KlGauNEWinYWhC2wcRCK/ND/7lwq/XcVmPL2DjNKtgQvi8EZ31ps8PZyZe8xCkxVN5p4ToWqbZbvFTuYoZNMl2HAT6L4NWyv2gPiXKiLkoIHlDePK8EKPHh+O6odb8jv6HjCmKeAkdZBIo96K1awDsgn1lsUnraEXShYpc/4fvxvcaRQVARA0V2jTgH7Ul+sxioZ7g2lklhRUfGb+AZo751xkRPZLgAAAABJRU5ErkJggg==\" alt=\"H_p(x)\" style=\"width: 40px; height: 20px;\" width=\"40\" height=\"20\"\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: 90.625px 7.79167px; transform-origin: 90.625px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e for given values of the order \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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: 47.0667px 7.79167px; transform-origin: 47.0667px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e and argument \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ex\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: 1.94167px 7.79167px; transform-origin: 1.94167px 7.79167px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Hp = StruveFn(p,x)\r\n  Hp = f(x,p);\r\nend","test_suite":"%%\r\nx = 0;\r\np = randi(8,1);\r\nHp_correct = 0;\r\nassert(isequal(StruveFn(p,x),Hp_correct))\r\n\r\n%%\r\nx = 0.4;\r\np = 0;\r\nHp_correct = 0.2501497138634162;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = 10;\r\np = 0;\r\nHp_correct = 0.1187436836875042;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = rand(1);\r\np = 1/2;\r\nHp_correct = sqrt(2/(pi*x))*(1-cos(x));\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = 4.2;\r\np = 1;\r\nHp_correct = 1.036818631956923;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%% \r\nx = pi^2;\r\np = 3;\r\nHp_correct = 4.10841348624688;\r\nassert(abs(StruveFn(p,x)-Hp_correct)/Hp_correct\u003c1e-6)\r\n\r\n%%\r\nx = rand(1);\r\np = 1;\r\nHp_approx = 2/pi - besselj(0,x) + (16/pi-5)*sin(x)/x + (12-36/pi)*(1-cos(x))/x^2;\r\nassert(abs(StruveFn(p,x)-Hp_approx)/Hp_approx\u003c0.002)","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":46909,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":"2021-01-02T18:43:17.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-21T16:48:35.000Z","updated_at":"2026-01-09T13:52:55.000Z","published_at":"2020-06-21T17:11: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: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=\\\"https://en.wikipedia.org/wiki/Struve_function\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eStruve function\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\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"H_p(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\bf H}_p(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is a solution to an inhomogeneous form of Bessel's equation:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e        \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"true\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"Differential equation from the Wikipedia link\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex^2\\\\frac{d^2y}{dx^2}+x\\\\frac{dy}{dx}+(x^2-p^2)y=\\\\frac{4(x/2)^{p+1}}{\\\\sqrt{\\\\pi}\\\\Gamma(p+1/2)}\u003c/w:t\u003e\u003c/w:r\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:r\u003e\u003cw:t\u003eThe Struve function appears in applications of optics and loudspeaker design. I encountered it in developing a model of turbulence in a strongly stratified fluid (e.g., a lake with a large temperature difference).\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\u003eEvaluate the Struve function\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"H_p(x)\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e{\\\\bf H}_p(x)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e for given values of the order \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"p\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and argument \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"x\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":3031,"title":"Expression or variable?","description":"Test if arguments of the function are all variables (workspace variables names). \r\nReturn 1 if yes, 0 if no.\r\n\r\nFor example : \r\n\r\n\r\na=1;\r\n\r\nb=2;\r\n\r\nc=3;\r\n\r\n* are_variables(a,b)    -\u003e 1\r\n* \r\n* are_variables(a,b,1)  -\u003e 0       \r\n\r\n\r\nEasy ?","description_html":"\u003cp\u003eTest if arguments of the function are all variables (workspace variables names). \r\nReturn 1 if yes, 0 if no.\u003c/p\u003e\u003cp\u003eFor example :\u003c/p\u003e\u003cp\u003ea=1;\u003c/p\u003e\u003cp\u003eb=2;\u003c/p\u003e\u003cp\u003ec=3;\u003c/p\u003e\u003cul\u003e\u003cli\u003eare_variables(a,b)    -\u0026gt; 1\u003c/li\u003e\u003cli\u003e\u003c/li\u003e\u003cli\u003eare_variables(a,b,1)  -\u0026gt; 0\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eEasy ?\u003c/p\u003e","function_template":"function y = are_variables(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\nassert(isequal(are_variables(x),1))\r\n%%\r\nx = 1;\r\nassert(isequal(are_variables(1),0))\r\n%%\r\nx = 1;\r\nassert(isequal(are_variables('x'),0))\r\n%%\r\nassert(isequal(are_variables('x',1,2),0))\r\n%%\r\na = 1;\r\nb=0;\r\nassert(isequal(are_variables(a,b),1))\r\n%%\r\nassert(isequal(are_variables(1,2,3,4,5),0))\r\n%%\r\na = 1;\r\nassert(isequal(are_variables(a,a,a),1))\r\n%%\r\na = 1;\r\nb=0;\r\nc=ones(5);\r\nassert(isequal(are_variables(a,'a'),0))\r\n%%\r\nx = 1;\r\ny=0;\r\nzz=ones(5);\r\nassert(isequal(are_variables(zz,'a'),0))\r\n%%\r\nx = 1;\r\ny=0;\r\nz=ones(5);\r\nassert(isequal(are_variables(x,y,z),1))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":"2015-02-20T11:18:22.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-20T11:17:48.000Z","updated_at":"2026-01-13T16:04:55.000Z","published_at":"2015-02-20T11:18:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eTest if arguments of the function are all variables (workspace variables names). Return 1 if yes, 0 if no.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example :\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ea=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:r\u003e\u003cw:t\u003eb=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:r\u003e\u003cw:t\u003ec=3;\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\u003eare_variables(a,b) -\u0026gt; 1\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\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\u003eare_variables(a,b,1) -\u0026gt; 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:t\u003eEasy ?\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":651,"title":"Functional inputs","description":"Return an n-dimensional array whose elements are the results of a function over a set of vectors.\r\n\r\nThe (i,j,k, ...n)th element of the output matrix is the results of executing the function on the ith element of the first vector, jth element of the second, and so forth. The function will be passed in, accepts n arguments, and returns a single number.\r\n\r\nFor example, if the function is:\r\n\r\n    minus12 = @(a) a(1)-a(2);\r\n\r\nand the inputs are:\r\n\r\n    as = [1 3 5 7];\r\n    bs = [0 1 2 3 4];\r\n\r\nthen the output would be:\r\n\r\n    \u003e\u003e gridit(minus12, as, bs)\r\n    ans =\r\n           1  0 -1 -2 -3\r\n           3  2  1  0 -1\r\n           5  4  3  2  1\r\n           7  6  5  4  3\r\n","description_html":"\u003cp\u003eReturn an n-dimensional array whose elements are the results of a function over a set of vectors.\u003c/p\u003e\u003cp\u003eThe (i,j,k, ...n)th element of the output matrix is the results of executing the function on the ith element of the first vector, jth element of the second, and so forth. The function will be passed in, accepts n arguments, and returns a single number.\u003c/p\u003e\u003cp\u003eFor example, if the function is:\u003c/p\u003e\u003cpre\u003e    minus12 = @(a) a(1)-a(2);\u003c/pre\u003e\u003cp\u003eand the inputs are:\u003c/p\u003e\u003cpre\u003e    as = [1 3 5 7];\r\n    bs = [0 1 2 3 4];\u003c/pre\u003e\u003cp\u003ethen the output would be:\u003c/p\u003e\u003cpre\u003e    \u003e\u003e gridit(minus12, as, bs)\r\n    ans =\r\n           1  0 -1 -2 -3\r\n           3  2  1  0 -1\r\n           5  4  3  2  1\r\n           7  6  5  4  3\u003c/pre\u003e","function_template":"function out = gridit(fn, varargin)\r\n  out = [];\r\nend\r\n","test_suite":"%%\r\nx1 = [ 1 2 3 ];\r\nx2 = [ 10 20 ];\r\ny_correct = [11 21; 12 22; 13 23];\r\nassert(isequal(gridit(@sum, x1, x2), y_correct));\r\n\r\n%%\r\nx1 = [ 1 2 3 ];\r\nx2 = [ 10 20 ];\r\nx3 = [ 0 100 ];\r\ny_correct(:,:,1) = [11 21; 12 22; 13 23];\r\ny_correct(:,:,2) = y_correct(:,:,1) + 100;\r\nassert(isequal(gridit(@sum, x1, x2, x3), y_correct));\r\n\r\n%%\r\nassert(isequal(gridit(@sum, 2,3),5));","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":78,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2012-05-02T15:44:58.000Z","updated_at":"2026-01-23T15:32:17.000Z","published_at":"2012-05-02T15:44:58.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\u003eReturn an n-dimensional array whose elements are the results of a function over a set of vectors.\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 (i,j,k, ...n)th element of the output matrix is the results of executing the function on the ith element of the first vector, jth element of the second, and so forth. The function will be passed in, accepts n arguments, and returns a single number.\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 function is:\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[    minus12 = @(a) a(1)-a(2);]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand 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[    as = [1 3 5 7];\\n    bs = [0 1 2 3 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:t\u003ethen the output would 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[    \u003e\u003e gridit(minus12, as, bs)\\n    ans =\\n           1  0 -1 -2 -3\\n           3  2  1  0 -1\\n           5  4  3  2  1\\n           7  6  5  4  3]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":42618,"title":"Is this function available?","description":"Sometimes it is difficult to remember which functions are not allowed on the Cody platform. Given a function as a string, return true if it is available on Cody and false otherwise.\r\n\r\nThe test suite will be updated periodically, so hard-coding the answers will eventually fail.\r\n\r\n*Examples*\r\n\r\n  isavailable('bsxfun') returns true\r\n\r\n  isavailable('pdist2') returns false","description_html":"\u003cp\u003eSometimes it is difficult to remember which functions are not allowed on the Cody platform. Given a function as a string, return true if it is available on Cody and false otherwise.\u003c/p\u003e\u003cp\u003eThe test suite will be updated periodically, so hard-coding the answers will eventually fail.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eisavailable('bsxfun') returns true\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eisavailable('pdist2') returns false\r\n\u003c/pre\u003e","function_template":"function tf = isavailable(f)\r\n  tf = true;\r\nend","test_suite":"%%\r\nassert(isequal(isavailable('sum'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('mean'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('bsxfun'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('pdist'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('hankel'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('std'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('evalin'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('toeplitz'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('pdist2'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('assignin'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('cell2mat'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('arrayfun'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('cellstr'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('imfindcircles'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('imread'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('plot'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('ocr'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('cellfun'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('dec2bin'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('eval'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('randi'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('rng'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('fread'),true))\r\n\r\n%%\r\nassert(isequal(isavailable('houghlines'),false))\r\n\r\n%%\r\nassert(isequal(isavailable('kron'),true))","published":true,"deleted":false,"likes_count":1,"comments_count":10,"created_by":4793,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":"2015-09-18T20:36:50.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-09-18T20:33:30.000Z","updated_at":"2026-03-13T12:52:05.000Z","published_at":"2015-09-18T20:33:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSometimes it is difficult to remember which functions are not allowed on the Cody platform. Given a function as a string, return true if it is available on Cody and false otherwise.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe test suite will be updated periodically, so hard-coding the answers will eventually fail.\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\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[isavailable('bsxfun') returns true\\n\\nisavailable('pdist2') returns false]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"functions\"","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:\"functions\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"functions\"","","\"","functions","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f45e58a0ca0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f45e58a0c00\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f45e58a0340\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f45e58a0f20\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f45e58a0e80\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f45e58a0de0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f45e58a0d40\u003e":"tag:\"functions\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f45e58a0d40\u003e":"tag:\"functions\""},"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:\"functions\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"functions\"","","\"","functions","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f45e58a0ca0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f45e58a0c00\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f45e58a0340\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f45e58a0f20\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f45e58a0e80\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f45e58a0de0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f45e58a0d40\u003e":"tag:\"functions\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f45e58a0d40\u003e":"tag:\"functions\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":3004,"difficulty_rating":"easy"},{"id":45976,"difficulty_rating":"easy-medium"},{"id":3031,"difficulty_rating":"easy-medium"},{"id":651,"difficulty_rating":"easy-medium"},{"id":42618,"difficulty_rating":"medium"}]}}