{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.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-04-06T00: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":42940,"title":"modulus of a number","description":"find the modulus of a given number","description_html":"\u003cp\u003efind the modulus of a given number\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = abs(x);\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = -1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = -3;\r\ny_correct = 3;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":86789,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":232,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-09-01T21:06:06.000Z","updated_at":"2026-04-09T09:35:17.000Z","published_at":"2016-09-01T21:06:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efind the modulus of a given number\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":44264,"title":"Calculate feeling temperature before climbing a mountain","description":"I sometimes climb a mountain.\r\nAs is well known, when the altitude becomes 100 (m) higher, the temperature lowers by 0.6 degrees Celsius.\r\nIn addition there is wind.\r\nAt wind velocity 1(m/s), the feeling temperature falls  1 degree Celsius.\r\n\r\ne.g.\r\n\r\n* temperature of the level ground(gT) : 25 degrees Celsius\r\n* wind velocity(v) : 10 m/s\r\n* at altitude(h) : 3000 m\r\n\r\nIn this case, feeling temperature(fT) is calculated as -3 degrees Celsius.\r\n","description_html":"\u003cp\u003eI sometimes climb a mountain.\r\nAs is well known, when the altitude becomes 100 (m) higher, the temperature lowers by 0.6 degrees Celsius.\r\nIn addition there is wind.\r\nAt wind velocity 1(m/s), the feeling temperature falls  1 degree Celsius.\u003c/p\u003e\u003cp\u003ee.g.\u003c/p\u003e\u003cul\u003e\u003cli\u003etemperature of the level ground(gT) : 25 degrees Celsius\u003c/li\u003e\u003cli\u003ewind velocity(v) : 10 m/s\u003c/li\u003e\u003cli\u003eat altitude(h) : 3000 m\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eIn this case, feeling temperature(fT) is calculated as -3 degrees Celsius.\u003c/p\u003e","function_template":"function fT =  feeling_temperature(gT,h,v)\r\n  fT = gT;\r\nend","test_suite":"%%\r\ngT=25;\r\nh=3000;\r\nv=10;\r\n\r\nfT_correct = -3;\r\nassert(isequal(feeling_temperature(gT,h,v),fT_correct))\r\n\r\n%%\r\ngT=30;\r\nh=500;\r\nv=0;\r\n\r\nfT_correct=27;\r\nassert(isequal(feeling_temperature(gT,h,v),fT_correct))\r\n\r\n%%\r\ngT=28;\r\nh=2500;\r\nv=3;\r\n\r\nfT_correct=10;\r\nassert(isequal(feeling_temperature(gT,h,v),fT_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":102298,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":70,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-07-16T14:13:00.000Z","updated_at":"2026-03-30T18:25:51.000Z","published_at":"2017-07-16T14:28:25.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 sometimes climb a mountain. As is well known, when the altitude becomes 100 (m) higher, the temperature lowers by 0.6 degrees Celsius. In addition there is wind. At wind velocity 1(m/s), the feeling temperature falls 1 degree Celsius.\u003c/w:t\u003e\u003c/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\u003ee.g.\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\u003etemperature of the level ground(gT) : 25 degrees Celsius\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\u003ewind velocity(v) : 10 m/s\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\u003eat altitude(h) : 3000 m\u003c/w:t\u003e\u003c/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\u003eIn this case, feeling temperature(fT) is calculated as -3 degrees Celsius.\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":44035,"title":"determine the sum of the squares","description":"if x = 4, the solution will be: y = 1^2+2^2+3^2+4^2=1+4+9+16 = 30.","description_html":"\u003cp\u003eif x = 4, the solution will be: y = 1^2+2^2+3^2+4^2=1+4+9+16 = 30.\u003c/p\u003e","function_template":"function y = sum_square(x)\r\n  y = 0;\r\nend","test_suite":"%%\r\nx = 4;\r\ny = 30;\r\nassert(isequal(sum_square(x),y))\r\n%%\r\nx = 6;\r\ny = 91;\r\nassert(isequal(sum_square(x),y))\r\n%%\r\nx = 5;\r\ny = 55;\r\nassert(isequal(sum_square(x),y))\r\n%%\r\nx = 15;\r\ny = 1240;\r\nassert(isequal(sum_square(x),y))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":108804,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":129,"test_suite_updated_at":"2017-01-22T22:33:23.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-01-22T22:14:42.000Z","updated_at":"2026-04-07T18:51:59.000Z","published_at":"2017-01-22T22:14:42.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eif x = 4, the solution will be: y = 1^2+2^2+3^2+4^2=1+4+9+16 = 30.\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":45936,"title":"Bit to Gigabyte","description":"1 bit =\r\n1.25 × 10^-10 gigabytes | x is bit | y is gigabyte","description_html":"\u003cp\u003e1 bit =\r\n1.25 × 10^-10 gigabytes | x is bit | y is gigabyte\u003c/p\u003e","function_template":"function y = bittogigabyte(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 14400000000;\r\ny_correct = 1.8;\r\nassert(isequal(bittogigabyte(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":5,"created_by":441903,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":173,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:23:02.000Z","updated_at":"2026-04-07T18:51:24.000Z","published_at":"2020-06-14T12:23:02.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1 bit = 1.25 × 10^-10 gigabytes | x is bit | y is gigabyte\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":44678,"title":"Calculate time taken by light to reach earth surface","description":"We know the time(seconds) taken by light to reach surface of earth. What if the distance varies yearly or source of light moves from one planet to another? How the time(seconds) varies?\r\n","description_html":"\u003cp\u003eWe know the time(seconds) taken by light to reach surface of earth. What if the distance varies yearly or source of light moves from one planet to another? How the time(seconds) varies?\u003c/p\u003e","function_template":"function y= light_time(x)\r\n  \r\n  y=x;\r\n  \r\nend","test_suite":"%%\r\nx =150000000 ;\r\ny_correct = 500;\r\nassert(isequal(light_time(x),y_correct))\r\n%%\r\nx=1800000;\r\ny_correct = 6;\r\nassert(isequal(light_time(x),y_correct))\r\n%%\r\nx=300000;\r\ny_correct = 1;\r\nassert(isequal(light_time(x),y_correct))\r\n%%\r\nx=57909000;\r\ny_correct = 193;\r\nassert(isequal(light_time(x),y_correct))\r\n%%\r\nx=5790960000;\r\ny_correct = 1.9303e+04;\r\nassert(isequal(light_time(x),y_correct))\r\n\r\n\r\n\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":220577,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":49,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-06-07T09:16:16.000Z","updated_at":"2026-03-04T13:43:37.000Z","published_at":"2018-06-07T09:16:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe know the time(seconds) taken by light to reach surface of earth. What if the distance varies yearly or source of light moves from one planet to another? How the time(seconds) varies?\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":44473,"title":"Let's make puddings !","description":"We will make puddings with eggs, milk and sugar.\r\nTo make one pudding, we need one egg, 140(cc) of milk, 15 (g) of sugar.\r\nNow We have x eggs,  y (cc) of milk, z (g) of sugar.\r\nHow many puddings can we make?\r\n\r\neg. When we have 3 eggs, 300cc milk, 300g sugar...\r\n\r\ninput :  x = 3, y = 300, z = 300\r\n\r\noutput :  Puddings= 2","description_html":"\u003cp\u003eWe will make puddings with eggs, milk and sugar.\r\nTo make one pudding, we need one egg, 140(cc) of milk, 15 (g) of sugar.\r\nNow We have x eggs,  y (cc) of milk, z (g) of sugar.\r\nHow many puddings can we make?\u003c/p\u003e\u003cp\u003eeg. When we have 3 eggs, 300cc milk, 300g sugar...\u003c/p\u003e\u003cp\u003einput :  x = 3, y = 300, z = 300\u003c/p\u003e\u003cp\u003eoutput :  Puddings= 2\u003c/p\u003e","function_template":"function Puddings = Egg_Milk_Sugar(x,y,z)\r\n  Puddings = 100;\r\nend","test_suite":"%% 1\r\nx = 3;\r\ny = 300;\r\nz = 300;\r\nC = 2;\r\nassert(isequal(Egg_Milk_Sugar(x,y,z),C))\r\n%% 2 \r\nx = 0;\r\ny = 999;\r\nz = 999;\r\nC = 0;\r\nassert(isequal(Egg_Milk_Sugar(x,y,z),C))\r\n%% 3\r\nx = 12;\r\ny = 1000;\r\nz = 100;\r\nC = 6;\r\nassert(isequal(Egg_Milk_Sugar(x,y,z),C))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":137687,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":55,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-12-27T02:51:08.000Z","updated_at":"2026-02-05T15:36:08.000Z","published_at":"2017-12-27T03:32:17.000Z","restored_at":"2018-02-06T15:11:49.000Z","restored_by":null,"spam":false,"simulink":false,"admin_reviewed":true,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe will make puddings with eggs, milk and sugar. To make one pudding, we need one egg, 140(cc) of milk, 15 (g) of sugar. Now We have x eggs, y (cc) of milk, z (g) of sugar. How many puddings can we make?\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\u003eeg. When we have 3 eggs, 300cc milk, 300g sugar...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput : x = 3, y = 300, z = 300\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput : Puddings= 2\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":44634,"title":"Basic matrix operations using standard MATLAB commands","description":"Create the matrix:\r\n\r\n 1.0e+15 *\r\n\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0001    0.0010    0.0100    0.1000    1.0000\r\n\r\nFind the row vector of all column means\r\n\r\nHint: Use _logspace_ to create the matrix. Avoid looking at the test suite before writing a solution","description_html":"\u003cp\u003eCreate the matrix:\u003c/p\u003e\u003cpre\u003e 1.0e+15 *\u003c/pre\u003e\u003cpre\u003e    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0001    0.0010    0.0100    0.1000    1.0000\u003c/pre\u003e\u003cp\u003eFind the row vector of all column means\u003c/p\u003e\u003cp\u003eHint: Use \u003ci\u003elogspace\u003c/i\u003e to create the matrix. Avoid looking at the test suite before writing a solution\u003c/p\u003e","function_template":"function y = matrix_ls_means()\r\n  y = x;\r\nend","test_suite":"%%\r\ny_correct = mean([logspace(1,5,5);logspace(6,10,5);logspace(11,15,5)]);\r\nassert(isequal(matrix_ls_means(),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2018-05-09T05:37:01.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-09T05:32:41.000Z","updated_at":"2026-02-17T08:19:25.000Z","published_at":"2018-05-09T05:35:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eCreate the matrix:\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[ 1.0e+15 *\\n\\n    0.0000    0.0000    0.0000    0.0000    0.0000\\n    0.0000    0.0000    0.0000    0.0000    0.0000\\n    0.0001    0.0010    0.0100    0.1000    1.0000]]\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\u003eFind the row vector of all column means\u003c/w:t\u003e\u003c/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: Use\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003elogspace\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to create the matrix. Avoid looking at the test suite before writing a solution\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":2121,"title":"Find offset of given matrix element from first matrix element","description":"Given matrix m and an element of that matrix, return the offset from its first element.\r\ne.g. m=[11 2 34; 40 51 6; 87 8 109]\r\nelement = 51\r\nThen, offset = 5\r\n\r\nReturn 0, if that element if not a matrix element","description_html":"\u003cp\u003eGiven matrix m and an element of that matrix, return the offset from its first element.\r\ne.g. m=[11 2 34; 40 51 6; 87 8 109]\r\nelement = 51\r\nThen, offset = 5\u003c/p\u003e\u003cp\u003eReturn 0, if that element if not a matrix element\u003c/p\u003e","function_template":"function offset= FindOffset(m, element)\r\n  y = x;\r\nend","test_suite":"%%\r\nm=[11 2 34; 40 51 6; 87 8 109]\r\nelement = 51;\r\noffset = 5;\r\nassert(isequal(FindOffset(m,element),offset));\r\n\r\n%%\r\nm=reshape([1:10],5,2);\r\nelement = 9;\r\noffset = 9;\r\nassert(isequal(FindOffset(m,element),offset));\r\n\r\n%%\r\nm=eye(7);\r\nelement = 0;\r\noffset = 2;\r\nassert(isequal(FindOffset(m,element),offset));\r\n\r\n%%\r\nm=[10 20 30 40; 50 60 70 80;];\r\nelement = 56;\r\noffset = 0;\r\nassert(isequal(FindOffset(m,element),offset));\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":16381,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":85,"test_suite_updated_at":"2014-01-15T19:28:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-01-15T19:21:32.000Z","updated_at":"2026-02-28T08:07:23.000Z","published_at":"2014-01-15T19:21:46.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven matrix m and an element of that matrix, return the offset from its first element. e.g. m=[11 2 34; 40 51 6; 87 8 109] element = 51 Then, offset = 5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReturn 0, if that element if not a matrix element\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":44303,"title":"Find the sum of the largest two elements in a vector","description":"With this one, you have to find the two largest elements in a vector and output the sum of those numbers.","description_html":"\u003cp\u003eWith this one, you have to find the two largest elements in a vector and output the sum of those numbers.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5];\r\ny_correct = 9;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 1:100;\r\ny_correct = 199;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 100:-1:1;\r\ny_correct = 199;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = ones(1,10);\r\ny_correct = 2;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 2:2:10;\r\ny_correct = 18;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [561 13 3544 89 65 4615 561 32 8 958 65 69451];\r\ny_correct = 74066;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":116,"test_suite_updated_at":"2017-09-08T19:49:23.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T01:25:16.000Z","updated_at":"2026-02-15T10:34:07.000Z","published_at":"2017-09-06T01:25:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWith this one, you have to find the two largest elements in a vector and output the sum of those numbers.\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":2068,"title":"Determine the square root","description":"Determine the square root of the value the user has entered, n.","description_html":"\u003cp\u003eDetermine the square root of the value the user has entered, n.\u003c/p\u003e","function_template":"function y = your_fcn_name(n)\r\n  y = n;\r\nend","test_suite":"%%\r\nn = 4;\r\ny_correct = 2;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn = 16;\r\ny_correct = 4;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn = 285156;\r\ny_correct = 534;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":2,"created_by":21190,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":792,"test_suite_updated_at":"2014-01-14T22:26:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-12-20T14:22:47.000Z","updated_at":"2026-03-16T15:29:27.000Z","published_at":"2013-12-20T14:22:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine the square root of the value the user has entered, n.\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":56408,"title":"Zero or hero","description":"A number will be given as an input. You can be hero if it's not zero.\r\n(Just for fun)","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 25.5px; transform-origin: 343px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eA number will be given as an input. You can be hero if it's not zero.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e(Just for fun)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 'Hero';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 0;\r\ny_correct = 'Zero';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 'Hero';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = 'Hero';\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":589324,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-10-23T03:54:31.000Z","updated_at":"2026-02-15T11:01:40.000Z","published_at":"2022-10-23T03:54:31.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA number will be given as an input. You can be hero if it's not zero.\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(Just for fun)\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":45927,"title":"GPA","description":"Math's credit is 5 and you got x | Physics's credit 7 and you got y what is your GPA ","description_html":"\u003cp\u003eMath's credit is 5 and you got x | Physics's credit 7 and you got y what is your GPA\u003c/p\u003e","function_template":"function z = gpa(x,y)\r\n  z = x and y;\r\nend","test_suite":"%%\r\nx = 75;\r\ny = 81;\r\nz_correct = 78.5;\r\nassert(isequal(gpa(x,y),z_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":441903,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":115,"test_suite_updated_at":"2020-06-14T12:04:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:00:53.000Z","updated_at":"2026-02-15T11:17:42.000Z","published_at":"2020-06-14T12:04:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMath's credit is 5 and you got x | Physics's credit 7 and you got y what is your GPA\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":45933,"title":"Watt","description":"Ampere x Volt = Watt","description_html":"\u003cp\u003eAmpere x Volt = Watt\u003c/p\u003e","function_template":"function y = watt(A,V)\r\n  y = A and V;\r\nend","test_suite":"%%\r\nV = 24;\r\nA = 15;\r\ny_correct = 360;\r\nassert(isequal(watt(A,V),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":441903,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":112,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:17:37.000Z","updated_at":"2026-02-15T11:18:17.000Z","published_at":"2020-06-14T12:17:37.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAmpere x Volt = Watt\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":45930,"title":"Mile to Kilometer","description":"x is mile and y is km","description_html":"\u003cp\u003ex is mile and y is km\u003c/p\u003e","function_template":"function y = miletokm(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 100;\r\ny_correct = 160.9344;\r\nassert(isequal(miletokm(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":441903,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":170,"test_suite_updated_at":"2020-06-14T12:07:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:06:46.000Z","updated_at":"2026-03-22T02:39:40.000Z","published_at":"2020-06-14T12:07:50.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex is mile and y is km\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":1801,"title":"03 - Matrix Variables 5","description":"Make the following variable:\r\n\r\n\u003c\u003chttp://samle.dk/STTBDP/Assignment1_3e.png\u003e\u003e\r\n","description_html":"\u003cp\u003eMake the following variable:\u003c/p\u003e\u003cimg src = \"http://samle.dk/STTBDP/Assignment1_3e.png\"\u003e","function_template":"function eMat = MatrixFunc()\r\n  *Insert code here\r\nend","test_suite":"%%\r\nref = [13 -1 5;-22 10 -87];\r\nuser = MatrixFunc();\r\nassert(isequal(user,ref))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":15468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":632,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-13T14:06:57.000Z","updated_at":"2026-02-09T13:43:25.000Z","published_at":"2013-08-13T14:06:57.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"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\u003eMake the following variable:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOUAAABLCAIAAAAAvdffAAALj0lEQVR42u2de1wTVxbHJzFijVpowQIfRQWUWqi6aMVtEbVWQBd3cdH1AWqVtRpfsXat7C5akVbxsRp5bXf56KpVgVLqA8tD+KhQRUV80lILEkkFETAEMREJSYadR0ImT8BMEpDz+0snQO7MfOfcc8499wzSBgL1HCFwCUDAKwgEvIKAV7gEIOAVBAJeQcArXAIQ8AoCAa8g4BUuAQh47UZSSPNCnVmIppjMGenlLXD7ravaPC6boXVnENfJvMdo7+Y1zI1z6wUKfHR/Pecn+vkBr13mtbkk92Bs7JZZHsM3HRPofCqvLj66dKojZgwYDI8VURk1MuufppifmxDL2zTf83dzjzVZ8NkU3Yge0UdtJBkMz5isGuDVkrxKcnas2Lx/F0Gkkw6vckFuTMSBQjHa1tpY9OUCLwTpP52TIbaq+W688a8lq2N2rJ1qgyCW5bUumetNnc0Hj95S3gr21Qr+gCQn+n1dXltF+UknShWq/0qfpAbaM/uy55+vs76NJU2dJXnFTj/Ia911IW3nDrzSzKuYf+teg/r2oPKi9eNsGYzxSdee9T5em68m/nnOlkIF+K/dllctkbyOmsar7gYurIV5Jc8d8wHcfDkHYlNKG2TAazfnFfNlN7q7L8kpf94dztSyvOLnPoSJUCItj7WEWw+8dk9em+9mRUywNSkc7un+K+7QNxYfjtsya9RA05MDwKu5eEXl5fGLvVSWxT54XXqNrJfyqpIwLyEMM7eQH+jO/oAwPyWKMC324by7CtqHjkoe8SuMiV9LPS2r8qq8YiaGnsCreeMtTM/KE31smSbaFUPZokB7JmJYWnk0a/NKDqDjKwa8WpPXtraq+EUjzMFrj/IHlA/YTHuwrz2BVytS0q3sq9sgk5ZOgFez84obFcfAtHvWT2lZm9e6ZO5kE/144PWleSVXxrV4JZOODn/kHLh8HwdUzM/aPD9g87F7CuufqDIhaile8VmFxfaNOJBN5EaEeQlLAxYcMTFPAry+VL0LblmpUlMr5p8OJyqzMGF3a/P+JBLc7mBZqSM2P7VE+vl1MhzsP2nuP49m3zf9oQVeof61Jwl4BV6BVwoMj67ELwzydsD3mzB9Qr/VNwc1Xdg/eyA+WfV3HROSVFAPvIKsaV/b63T07bxRPL7+1Rhik47d8A13JFYIS2TivSNtPE89BV57gEQFYba2IT8rzMlrU8mut1k4ka/ZrtIyYzJxAWfCG+RajP+GXGlXMHt4JTW3VAL2FewrvbxKixJnO7i6OTERnTJ70ZlIv7GBs7zxKHJoZFp152H9rfArH6eQnOpW4BV4fUleZZKHl84ejYtNTM35tVn9Fyv3hXiG74wKtGdqbpJW1BR+4Tn848OHVr3B0EUZw+jJzXPH4mLjD6fffCTIP5hw5PpvLYRJLj8Zv3KsPcvBg3ux7GGTFAVegdeu8iq5c3ar3yif9XuS0+KWOjKHR6Y9VFpXfMn49wevngx1xnwC15gsIXm85UnWYi+vyLSSM5ETMW/AfQqvRu2UoE3802tnjvkwbNfZgkvf7w71cnuLZROMWVNUUXZg+Udj3TEXgvmWq/fkyfOOai9GS588NF6zVCmUyIHX3syr5GbyJy79xsZkVqPK1LQd5+tfSRgEmatd8FKPe9umD1bn1dHHJ7g+H4SlNMhu/83HDkHYf4kuVo0BfVpxYs7b9jNWZzQplEMcb8NwHhf9QGl/ybK0UTFZdUZiO8PSXkEFXnsVr61lZ9e59GUHbsh5jmL3vnRXiFu/N+dlPiDn/cb0TROmcjJbUHx1DkEGLeP9jE3p/HOfjRy2LP+RVFKR+F5/BrUmUiYu3OA72HbYJ4V1rZRwrX+watsaqsARtxm0+JJIDvks4LVrvL6oTQ8e8Vofm6CMB8+FFZkRczxdxiw5cbUOVVs7dyKQakzmvoMZNz9O1nOlJ1CJtsnLUhfbIMgAR84NMUljU3b0FCZit5xXohqS9NahEBbFmrY8/mba60yvoEMimgADXnsPr82XeAFYbM92mhT0hw98A8L3Hf6xrgWlZrJGs4OJKF56PTEI43VcSHTMx17vh6WIcD4fJy0biR2cGJomQUnf8+SfnG2osReq+CXK35FyhECcMShs9y0DYwb/FXg1KCz2d0EQx1W8whqRVG8mSxVIKU0p3uHDY901Yq6XN19Y7sHGDnAPVZDkVJ4K78eglmLIKn5Y68ikRmPCZO67RvZUgP8KvBoRHkVRo37i9gtultRjfxBFy2NmD2v3O8lec8w+yrCsTVU0xGT5f1dGOrtKG4z5DDJ1DgGDD3deXzTcKbwrUsgurxrNxv2HZ7X5P1x7RgdjwGvv4RULp7wxnj7inBTibkCLoPj4mgXrs8vE2Gfi+4kTBw7ffrq2/ZvG2wxoj/pVrip10Utpg92n7BW0yIQVGRsXrv4ywp/FcF6z/3+fL9xwvrKFXCp7b9F/s//96c5TAloQA157UbwlbSjYOH0IZhQHOHlO9PLwm7ezUCDBDt/L3RMy0QlB+o72WxmXdvtFW1vr01Mh49YTnoCi7m7qP1bPHNoXX6Rl9vUM27Q7+7YIR6flZuSMoWQDVlef9XlljbcPzcGYtndfRj4D9QWfv8nEjPQ7f//mF7o2SAOvvSqfhS9rXTmXlpKec720XsUQ2iyqag9wBLXKaEoikap+pZZvIAZSSGuLL57LvXC3gYjbFNKqK3lXq56pIiRUdCc/9/JtOnfzA6+9i9eeLpp4bS45F9/e8/WvW49rtYsS83NjiHaWRLH91jNFtJVNGm3sio0qhuytwmL7fnGkyPJtPSknjti5zd17XD0GQ8GxkXgaeKWlnrD5Vkr4EM1OANQeb2L+idkeA6mfstj07EA02tgVH5XLQN+YDHwjCjEGOwt3oiV6Lzgs2HqR+FKyQZND+5ZD3V06HfaItUQ94SvPa6soa/G700gs2hvvUBJn+L5QVUsieXVxAmnwaNxBpXfjKzaqsNF2wZR2lviPsSzZ2VO38QK+lq46gv07RGcnJvYrI4MNt+AEXk3nVV72bcRujTZm5IZE5Rqy9Ml3a7kaVo3Ei8YOGvp4xZMt/TQnVnL+tXA/TV1eVas/NWeT87WMfYcNNYBX03lt/ul8gWYASC7CKXkV83+8orlFluwjZGZecdumU6Wp96D5RFYmUXsS4ubTsE+CXzdno5cFeDXHfhiSV4OtNEhezeoP6LNtbbR0XOu6/8rEQj3CWcJbEPjP4xluXNyBMwC8mpFXI3bC9DZSHfJqwIR3vocSbZei6toOogvBIDe3Scb7FXfmsgCv9OdfMdvGHe//n8J6w7OkvypkfuV5baOWjti5GWk1jv/YgAEd+CqQzzLOq7yptrJL1V7ESyYWrjDcJQqbIgMCaH6dgeV51Vnx0ZZqkQjPlnhP4z2ov0a82skIsvjYOvSRgFfjvJJl5p2v9sKmv/0btxu0na2iS5Fr9vzUQHO40yVe6fBf1SbTkIjB4B27hvZp/zphZrS/jWZmWjOZMKLDBwl4pdMfEPNTudzjhhaLUXn5159GmOPdG4byAzq8WjQ/QMZ8GtXM8tKoAGe9D0wnW20Cr7Tx2irK4ixK0LQczQ8qHqkcg7qUz1ZqrWlJBBW1MjPxav38q7535RlySDrlDACvtPGqb6KXVxXF7Ushb4wwa8fGJM0IDPuV7du+pwUdw+tbQ6j9VmnPS3Qk3JxrWlP9Br6TzgDwSg+vmm+D0X19gJ7qAr07HV7amzTQ2BU/3l4/QLzMdqxl6weUySz3yduIJ1lZP6CbG+l8323g1XReddvBavRYNVTVQYsf2VFjV3XVGKV1sCUlry5O2TTfE9FXn0W9gJ1c7QNeof61Jwl4BV6BV+AVBLwCryDgFXgFXoFXEPBqPl5DnVlaySbNVrUg64jssaIlfW8V6E28gl4lAa8g4BUEAl5BIOAVBLyCQMArCAS8gnqS/g+84HIYNkbRxgAAAABJRU5ErkJggg==\"}]}"},{"id":52148,"title":"MATLAB Basics: Complex Argument","description":"For a given complex number, x, return the argument, y, in degrees.","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: 20px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.493px 10px; transform-origin: 406.493px 10px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 383.49px 10px; text-align: left; transform-origin: 383.498px 10px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor a given complex number, x, return the argument, y, in degrees.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = argumentdeg(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1+i;\r\ny_correct = 45;\r\nassert(isequal(argumentdeg(x),y_correct))\r\n%%\r\nx = 45i;\r\ny_correct = 90;\r\nassert(isequal(argumentdeg(x),y_correct))\r\n%%\r\nx = 136;\r\ny_correct = 0;\r\nassert(isequal(argumentdeg(x),y_correct))\r\n%%\r\nx = 17-6i;\r\ny_correct = -(atan(6/17)*180/pi)\r\nassert(abs(argumentdeg(x)-y_correct)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1231855,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":69,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-28T14:26:52.000Z","updated_at":"2026-03-30T20:49:34.000Z","published_at":"2021-06-28T14:28:37.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\u003eFor a given complex number, x, return the argument, y, in degrees.\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":44546,"title":"Calculating the total earnings of a factory","description":"The row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.","description_html":"\u003cp\u003eThe row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.\u003c/p\u003e","function_template":"function earn = earnings(rate, price)\r\n    earn= (); % use your basic knowledge of matrix multiplication\r\nend","test_suite":"%%\r\nrate = [2,5,4];\r\nprice = [8,3,1];\r\ny_correct = 3360;\r\nassert(isequal(earnings(rate,price),3360))\r\n%%\r\nrate = [1,4];\r\nprice = [2,1];\r\ny_correct = 576;\r\nassert(isequal(earnings(rate,price),576))\r\n%%\r\nrate = [6 6 2 3 2 8];\r\nprice = [3 2 4 8 9 5];\r\ny_correct = 11520;\r\nassert(isequal(earnings(rate,price),11520))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-03-31T09:16:35.000Z","updated_at":"2026-02-11T11:25:03.000Z","published_at":"2018-03-31T09:16:35.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.\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":52133,"title":"MATLAB Basics: Complex Conjugates","description":"For a given complex number, x, return the complex conjugate, y.","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 200.5px 8px; transform-origin: 200.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor a given complex number, x, return the complex conjugate, y.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = compconj(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1+i;\r\ny_correct = 1-i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 1-i;\r\ny_correct = 1+i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 3i;\r\ny_correct = -3i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 7;\r\ny_correct = 7;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 7-13i;\r\ny_correct = 7+13i;\r\nassert(isequal(compconj(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":1231855,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":"2021-06-28T19:38:20.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-28T14:07:04.000Z","updated_at":"2026-02-11T18:32:04.000Z","published_at":"2021-06-28T14:07:36.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\u003eFor a given complex number, x, return the complex conjugate, y.\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":43319,"title":"Select primes from the matrix.","description":"Select primes from the matrix.","description_html":"\u003cp\u003eSelect primes from the matrix.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = magic(4);\r\ny_correct = [5\r\n     2\r\n    11\r\n     7\r\n     3\r\n    13];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = magic(5);\r\ny_correct = [17\r\n    23\r\n    11\r\n     5\r\n     7\r\n    13\r\n    19\r\n     2\r\n     3];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":98,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T17:01:20.000Z","updated_at":"2026-02-08T05:38:44.000Z","published_at":"2016-10-10T17:01:20.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSelect primes from the matrix.\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":43980,"title":"Find the binary code","description":"Given a sinusoidal signal, create a function that returns the binary code of a quantized value. The function takes the bit length and quantized value as the input.\r\n\r\n  Bit length = 3\r\n  Quantized value  = 2\r\n  Binary code      = 010\r\n","description_html":"\u003cp\u003eGiven a sinusoidal signal, create a function that returns the binary code of a quantized value. The function takes the bit length and quantized value as the input.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eBit length = 3\r\nQuantized value  = 2\r\nBinary code      = 010\r\n\u003c/pre\u003e","function_template":"function y = binaryCode(bitLen,quantizedValue)\r\n    \r\n  y = quantizedValue;  %Complete this function\r\n  \r\nend","test_suite":"%%\r\nnumBit = 2;\r\nanalogValue =1;\r\nbinary=binaryCode(numBit,analogValue);\r\nbinary_correct= '01';\r\nassert(isequal(binary,binary_correct))\r\n\r\n%%\r\nnumBit = 4;\r\nanalogValue =15;\r\nbinary=binaryCode(numBit,analogValue);\r\nbinary_correct= '1111';\r\nassert(isequal(binary,binary_correct))\r\n\r\n%%\r\nnumBit = 6;\r\nanalogValue =63;\r\nbinary=binaryCode(numBit,analogValue);\r\nbinary_correct= '111111';\r\nassert(isequal(binary,binary_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":107998,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":"2016-12-29T17:24:48.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-12-29T16:48:24.000Z","updated_at":"2026-02-11T14:09:51.000Z","published_at":"2016-12-29T17:10:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a sinusoidal signal, create a function that returns the binary code of a quantized value. The function takes the bit length and quantized value as the input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Bit length = 3\\nQuantized value  = 2\\nBinary code      = 010]]\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":45909,"title":"Convert Angstrom to Meters","description":"Write a code that converts the angstrom unit to meters.(A is angstrom and m is meters.)","description_html":"\u003cp\u003eWrite a code that converts the angstrom unit to meters.(A is angstrom and m is meters.)\u003c/p\u003e","function_template":"function m = conv_fcn_met(A)\r\n  m = ;\r\nend","test_suite":"%%\r\nA = 1;\r\nm_correct = 10^-10;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n%%\r\nA = 0;\r\nm_correct = 0;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n%%\r\nA = 10;\r\nm_correct = 10^-9;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n%%\r\nA = 400;\r\nm_correct = 4*10^-8 ;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n%%\r\nA = 30000;\r\nm_correct = 3*10^-6;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":444624,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":102,"test_suite_updated_at":"2020-06-13T17:36:05.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-13T17:27:41.000Z","updated_at":"2026-02-06T10:07:54.000Z","published_at":"2020-06-13T17:27:39.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a code that converts the angstrom unit to meters.(A is angstrom and m is meters.)\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":43318,"title":"Compare two strings.","description":"Compare two strings, whether they are equal or not.","description_html":"\u003cp\u003eCompare two strings, whether they are equal or not.\u003c/p\u003e","function_template":"function z = Comparer(x,y)\r\n  z = x==y;\r\nend","test_suite":"%%\r\nx = 'When you finish the test, you will be told your approximate English level. You can then search for suitable content on LearnEnglish Teens by level. You can also search for content by topic.';\r\ny='When you finish the test, you will be told your approximate English level. You can then search for suitable content on LearnEnglish Teens by level. You can also search for content by topic.';\r\ny_correct = true;\r\nassert(isequal(Comparer(x,y),y_correct))\r\n%%\r\nx = 'When you finish tee test, you will be told your approximate English level. You can then search for suitable content on LearnEnglish Teens by level. You can also search for content by topic.';\r\ny='When you finish the test, you will be told your approximate English level. You can then search for suitable content on LearnEnglish Teens by level. You can also search for content by topic.';\r\ny_correct = false;\r\nassert(isequal(Comparer(x,y),y_correct))\r\n%%\r\nx='Hello';\r\ny='Hi';\r\ny_correct = false;\r\nassert(isequal(Comparer(x,y),y_correct))\r\n%%\r\nx='Hello';\r\ny='Hello';\r\ny_correct = true;\r\nassert(isequal(Comparer(x,y),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":106,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T16:05:56.000Z","updated_at":"2026-02-09T14:59:17.000Z","published_at":"2016-10-10T16:05:56.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCompare two strings, whether they are equal or not.\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":44670,"title":"Basic Quadratic Equation","description":"Create the equation:\r\n\r\ny=(3x)^2+(5x)+35\r\nand compute y for various values of x","description_html":"\u003cp\u003eCreate the equation:\u003c/p\u003e\u003cp\u003ey=(3x)^2+(5x)+35\r\nand compute y for various values of x\u003c/p\u003e","function_template":"function y = quad1(x)\r\n\r\nend","test_suite":"%%\r\nx = -3;\r\ny_correct = 101;\r\nassert(isequal(quad1(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 285;\r\nassert(isequal(quad1(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":91,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-30T10:55:15.000Z","updated_at":"2026-02-13T15:28:08.000Z","published_at":"2018-05-30T10:55:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate the 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\u003ey=(3x)^2+(5x)+35 and compute y for various values of x\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":2104,"title":"construct matrix with identical rows","description":"Input a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x. \r\n\r\nExample \r\n\r\n L = 5\r\n\r\nThe resulting answer is:\r\n\r\n [1:10;\r\n  1:10;\r\n  1:10; \r\n  1:10;\r\n  1:10]\r\n\r\n","description_html":"\u003cp\u003eInput a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e L = 5\u003c/pre\u003e\u003cp\u003eThe resulting answer is:\u003c/p\u003e\u003cpre\u003e [1:10;\r\n  1:10;\r\n  1:10; \r\n  1:10;\r\n  1:10]\u003c/pre\u003e","function_template":"function c=consIdenticalRowMatrix(a,rows)\r\n%you code here\r\nend\r\n","test_suite":"%%\r\nx = [1:10];\r\ny_correct =[1:10;1:10];\r\nrows=2;\r\nassert(isequal(consIdenticalRowMatrix(x,rows),y_correct))\r\n\r\nx=1:5;\r\nrows=5;\r\ny_correct=[x;x;x;x;x];\r\nassert(isequal(consIdenticalRowMatrix(x,rows),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":9153,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":209,"test_suite_updated_at":"2014-06-25T08:39:31.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-01-11T10:17:53.000Z","updated_at":"2026-02-08T06:10:56.000Z","published_at":"2014-01-11T10:17:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eInput a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x.\u003c/w:t\u003e\u003c/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[ L = 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\u003eThe resulting answer 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[ [1:10;\\n  1:10;\\n  1:10; \\n  1:10;\\n  1:10]]]\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":46923,"title":"Half the length of the vector","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ex=[1 2 3 4 5 6 7 8]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ey=[1 3 5 7]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5 6 7 8];\r\ny_correct = [1 3 5 7];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [1.28 3.26 4.89 6.23 2.22];\r\ny_correct = [1.28 4.89 2.22];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17];\r\ny_correct = [1 3 5 7 9 11 13 15 17];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":628208,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-18T17:54:32.000Z","updated_at":"2026-02-12T19:00:53.000Z","published_at":"2020-10-18T17:54:32.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\u003ex=[1 2 3 4 5 6 7 8]\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\u003ey=[1 3 5 7]\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\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\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":43747,"title":"Find the distance traveled by a car given velocity and time.","description":"A car is traveling at a constant velocity for a specific amount of time. The function should use the two inputs, velocity and time, to find the distance traveled.","description_html":"\u003cp\u003eA car is traveling at a constant velocity for a specific amount of time. The function should use the two inputs, velocity and time, to find the distance traveled.\u003c/p\u003e","function_template":"function y = distance(velocity,time)\r\n  D = time;\r\nend","test_suite":"%%\r\nvelocity = 10;\r\ntime = 60; \r\nD_correct = 600;\r\nassert(isequal(distance(velocity,time),D_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":100857,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":130,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-07T20:05:40.000Z","updated_at":"2026-02-10T21:28:41.000Z","published_at":"2016-12-07T20:05:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA car is traveling at a constant velocity for a specific amount of time. The function should use the two inputs, velocity and time, to find the distance traveled.\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":3088,"title":"Compute LOG(1+X) in natural log ","description":"Compute LOG(1+X) in natural log \r\n\r\n","description_html":"\u003cp\u003eCompute LOG(1+X) in natural log\u003c/p\u003e","function_template":"function y = log1(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2;\r\ny_correct = 1.0986;\r\nassert( (log1(x)-y_correct)\u003c0.0001)\r\n%%\r\nx = 0;\r\ny_correct = 0;\r\nassert( (log1(x)-y_correct)\u003c0.0001)\r\n%%\r\nx = 1;\r\ny_correct = 0.6931;\r\nassert( (log1(x)-y_correct)\u003c0.0001)\r\n%%\r\nx = 9;\r\ny_correct = 2.3026;\r\nassert( (log1(x)-y_correct)\u003c0.0001)","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":264,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-03-17T05:14:16.000Z","updated_at":"2026-02-12T18:28:06.000Z","published_at":"2015-03-17T05:14:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCompute LOG(1+X) in natural log\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":53805,"title":"Find the summation, mean, median, mode and standard deviation of a given array.","description":"An array is given. Find out the summation, mean, median, mode and standard deviation of a given array.\r\nIf x=[1,2,2,3,3,3,4,4,4,4] \r\nthen the output will be\r\ny=[30.0000    3.0000    3.0000    4.0000    1.0541]","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAn array is given. Find out the summation, mean, median, mode and standard deviation of a given array.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIf x=[1,2,2,3,3,3,4,4,4,4] \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ethen the output will be\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ey=[\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003e30.0000    3.0000    3.0000    4.0000    1.0541\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1,2,2,3,3,3,4,4,4,4];\r\ny_correct = [30.0000    3.0000    3.0000    4.0000 std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 1:15;\r\ny_correct = [  120.0000    8.0000    8.0000    1.0000    std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [1,2,3,3,3,5,5,5,5,5,4,4,4,5];\r\ny_correct = [54.0000    mean(x)   4.0000    5.0000   std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 1:15:120;\r\ny_correct = [428.0000   53.5000   53.5000    1.0000 std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx =-50:10:50;\r\ny_correct = [0         0         0  -50.0000 std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":1458699,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":64,"test_suite_updated_at":"2022-01-09T18:01:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-01-09T17:42:15.000Z","updated_at":"2026-02-06T18:13:58.000Z","published_at":"2022-01-09T17:42: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\u003eAn array is given. Find out the summation, mean, median, mode and standard deviation of a given array.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf x=[1,2,2,3,3,3,4,4,4,4] \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen the output will be\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\u003ey=[\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e30.0000    3.0000    3.0000    4.0000    1.0541\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":2798,"title":"Beginner's Problem - Squaring","description":"Try out this test problem first.\r\n\r\nGiven the variable x as your input, square it by two and put the result in y.\r\n\r\nExamples:\r\n\r\n Input  x = 2\r\n Output y is 4\r\n\r\n Input  x = 10\r\n Output y is 100","description_html":"\u003cp\u003eTry out this test problem first.\u003c/p\u003e\u003cp\u003eGiven the variable x as your input, square it by two and put the result in y.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre\u003e Input  x = 2\r\n Output y is 4\u003c/pre\u003e\u003cpre\u003e Input  x = 10\r\n Output y is 100\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 25;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":1,"created_by":33468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":844,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-24T14:46:57.000Z","updated_at":"2026-03-26T01:18:23.000Z","published_at":"2014-12-24T14:46:57.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eTry out this test problem first.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the variable x as your input, square it by two and put the result in y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ Input  x = 2\\n Output y is 4\\n\\n Input  x = 10\\n Output y is 100]]\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":2389,"title":"Max of a Vector","description":"Write a function to return the max of a vector","description_html":"\u003cp\u003eWrite a function to return the max of a vector\u003c/p\u003e","function_template":"function y = FindMax(x)\r\n  \r\nend","test_suite":"%%\r\nx = [10 20 30];\r\ny_correct = 30;\r\nassert(isequal(FindMax(x),  y_correct))\r\n\r\n%%\r\nx = [1 2 3 4 3 2 1];\r\ny_correct = 4;\r\nassert(isequal(FindMax(x),   y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":24594,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":721,"test_suite_updated_at":"2014-06-25T20:05:00.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-25T20:02:30.000Z","updated_at":"2026-03-29T23:34:58.000Z","published_at":"2014-06-25T20:02: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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to return the max of a vector\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":2163,"title":"Evaluate Polynomial","description":"Given a polynomial equation coefficients in a vector p, you have to return its value at x.\r\n\r\nExample:\r\n\r\nFor inputs p and x\r\n\r\n p = [1 0 1]\r\n x = [1 4]\r\n\r\nOutput y is [1*1^2 + 1, 1*4^2 + 1] or \r\n\r\n y = [2 17]","description_html":"\u003cp\u003eGiven a polynomial equation coefficients in a vector p, you have to return its value at x.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cp\u003eFor inputs p and x\u003c/p\u003e\u003cpre\u003e p = [1 0 1]\r\n x = [1 4]\u003c/pre\u003e\u003cp\u003eOutput y is [1*1^2 + 1, 1*4^2 + 1] or\u003c/p\u003e\u003cpre\u003e y = [2 17]\u003c/pre\u003e","function_template":"function y = polynomial(p,x)\r\n  y = 0;\r\nend","test_suite":"%%\r\np = [1 0 -8 -7 5];\r\nx = [ 5 7 9 ];\r\ny_correct = [ 395  1965  5855];\r\nassert(isequal(polynomial(p,x),y_correct))\r\n\r\n%%\r\np = [1 0 -10 0 0 0 11 -50];\r\nx = [3 7 4 5];\r\ny_correct = [-260  655500  6138 46880]\r\nassert(isequal(polynomial(p,x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":11900,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":147,"test_suite_updated_at":"2014-02-07T15:58:46.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-02-07T05:50:19.000Z","updated_at":"2026-03-09T18:42:08.000Z","published_at":"2014-02-07T05:50:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a polynomial equation coefficients in a vector p, you have to return its value at x.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor inputs p and x\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[ p = [1 0 1]\\n x = [1 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\u003eOutput y is [1*1^2 + 1, 1*4^2 + 1] or\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[ y = [2 17]]]\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":45887,"title":"Which one is More bigger?","description":"we have two input like (x,y) our output (z) must wich one is bigger input.","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 223.5px 8px; transform-origin: 223.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewe have two input like (x,y) our output (z) must wich one is bigger input.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = P45691(x,y)\r\n  \r\nend","test_suite":"%%\r\nx = 1;\r\ny = 0;\r\nz_correct=x\r\nassert(isequal(P45691(x,y),z_correct))\r\n\r\n\r\n%%\r\nx = -1;\r\ny = 0;\r\nz_correct=y\r\nassert(isequal(P45691(x,y),z_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":452148,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":"2021-06-19T09:33:47.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-10T23:21:22.000Z","updated_at":"2026-03-09T18:41:33.000Z","published_at":"2020-06-10T23:21:22.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\u003ewe have two input like (x,y) our output (z) must wich one is bigger input.\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":52105,"title":"MATLAB Basics: Complex Numbers","description":"For a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].","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: 20px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.493px 10px; transform-origin: 406.493px 10px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 383.49px 10px; text-align: left; transform-origin: 383.498px 10px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = realimaginary(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1+i;\r\ny_correct = [1 1];\r\nassert(isequal(realimaginary(x),y_correct))\r\n%%\r\nx = 1.6+sqrt(2)*i;\r\ny_correct = [1.6 sqrt(2)];\r\nassert(isequal(realimaginary(x),y_correct))\r\n%%\r\nx = pi+156.78i;\r\ny_correct = [pi 156.78];\r\nassert(isequal(realimaginary(x),y_correct))\r\n%%\r\nx = 6i;\r\ny_correct = [0 6];\r\nassert(isequal(realimaginary(x),y_correct))\r\n%%\r\nx = 160000000;\r\ny_correct = [160000000 0];\r\nassert(isequal(realimaginary(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":1231855,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-25T08:23:44.000Z","updated_at":"2026-02-05T18:22:06.000Z","published_at":"2021-06-25T08:30:31.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\u003eFor a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].\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":2768,"title":"Union of two set decreasing order ","description":"Union of two set decreasing order \r\n\r\nSay, x=[1 2 5]\r\n\r\nand y=[5 7 8] \r\n\r\nthen answer must be [8 7 5 2 1] ","description_html":"\u003cp\u003eUnion of two set decreasing order\u003c/p\u003e\u003cp\u003eSay, x=[1 2 5]\u003c/p\u003e\u003cp\u003eand y=[5 7 8]\u003c/p\u003e\u003cp\u003ethen answer must be [8 7 5 2 1]\u003c/p\u003e","function_template":"function y = unique_x(x,y)\r\n  y = x;\r\nend","test_suite":"%%\r\n x=[1 2 5];\r\ny=[5 7 8];\r\ny_correct = [8 7 5 2 1];\r\nassert(isequal(unique_x(x,y),y_correct))\r\n\r\n%%\r\n x=[1];\r\ny=[1];\r\ny_correct = [1];\r\nassert(isequal(unique_x(x,y),y_correct))\r\n%%\r\n x=[10];\r\ny=[1];\r\ny_correct = [10 1];\r\nassert(isequal(unique_x(x,y),y_correct))\r\n%%\r\n x=[1 5 8];\r\ny=[2 4 6 4];\r\ny_correct = [8 6 5 4 2 1];\r\nassert(isequal(unique_x(x,y),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":131,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-09T09:40:24.000Z","updated_at":"2026-02-11T18:37:53.000Z","published_at":"2014-12-09T09:40:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUnion of two set decreasing order\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\u003eSay, x=[1 2 5]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand y=[5 7 8]\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\u003ethen answer must be [8 7 5 2 1]\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":44255,"title":"Average of even-numbered columns","description":"Given a vector, find the average of even-numbered columns.\r\n\r\ne.g\r\n\r\nx　=　[ 4 6 8 9 1 2 7 ]\r\n\r\ny =　( 6 + 9 + 2 ) / 3\r\n","description_html":"\u003cp\u003eGiven a vector, find the average of even-numbered columns.\u003c/p\u003e\u003cp\u003ee.g\u003c/p\u003e\u003cp\u003ex　=　[ 4 6 8 9 1 2 7 ]\u003c/p\u003e\u003cp\u003ey =　( 6 + 9 + 2 ) / 3\u003c/p\u003e","function_template":"function y = Ave_evenC(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [4 6 8 9 1 2 7];\r\ny_correct = (6+9+2)/3;\r\nassert(isequal(Ave_evenC(x),y_correct))\r\n\r\n%%\r\nx=[1:9];\r\ny_correct =(2+4+6+8)/4;\r\nassert(isequal(Ave_evenC(x),y_correct))\r\n\r\n%%\r\nx=repmat([5 0],1,10);\r\ny_correct=0;\r\nassert(isequal(Ave_evenC(x),y_correct))\r\n\r\n%%\r\nx=ones(1,51);\r\ny_correct=1;\r\nassert(isequal(Ave_evenC(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":102298,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":78,"test_suite_updated_at":"2017-07-09T08:26:53.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-07-09T08:02:08.000Z","updated_at":"2026-02-20T08:48:02.000Z","published_at":"2017-07-09T08:26:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a vector, find the average of even-numbered columns.\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\u003ee.g\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\u003ex　=　[ 4 6 8 9 1 2 7 ]\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\u003ey =　( 6 + 9 + 2 ) / 3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44242,"title":"Replace Nan!","description":"Replace Nan in the given vector(v) with 9999.","description_html":"\u003cp\u003eReplace Nan in the given vector(v) with 9999.\u003c/p\u003e","function_template":"function y = ReplaceNan(v)\r\n  y = v;\r\nend","test_suite":"%%\r\nx=[1 2 3 0/0 4];\r\ny_correct = [1 2 3 9999 4];\r\nassert(isequal(ReplaceNan(x),y_correct))\r\n\r\n%%\r\nx=[5:9];\r\ny_correct =[5:9];\r\nassert(isequal(ReplaceNan(x),y_correct))\r\n\r\n%%\r\nx=repmat(0/0,1,10);\r\ny_correct = repmat(9999,1,10);\r\nassert(isequal(ReplaceNan(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":102298,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-06-27T13:30:08.000Z","updated_at":"2026-02-13T18:08:24.000Z","published_at":"2017-06-27T13:33:17.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReplace Nan in the given vector(v) with 9999.\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":2980,"title":"multiply by three","description":"\r\nGiven the variable x as your input, multiply it by 3 and put the result equal to y.\r\n\r\nExamples:\r\n Input  x = 2\r\n Output y is 6\r\n Input  x = 10\r\n Output y is 30\r\n","description_html":"\u003cp\u003eGiven the variable x as your input, multiply it by 3 and put the result equal to y.\u003c/p\u003e\u003cp\u003eExamples:\r\n Input  x = 2\r\n Output y is 6\r\n Input  x = 10\r\n Output y is 30\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 3;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":3,"created_by":33999,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1014,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-07T05:00:06.000Z","updated_at":"2026-02-13T06:54:43.000Z","published_at":"2015-02-07T05:00:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the variable x as your input, multiply it by 3 and put the result equal to y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples: Input x = 2 Output y is 6 Input x = 10 Output y is 30\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":43305,"title":"Sum positive elements of matrix.","description":"Calculate sum of positive elements of the matrix.","description_html":"\u003cp\u003eCalculate sum of positive elements of the matrix.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [-5     1     6;\r\n    -5     5    -5;\r\n     4     9     2];\r\ny_correct = 27;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [ -2     2    -2    13;\r\n     5    11    10     8;\r\n    -2     7    -2    12;\r\n     4    14    15     1];\r\n y_correct = 102;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":130,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T11:28:08.000Z","updated_at":"2026-02-11T18:40:58.000Z","published_at":"2016-10-10T11:28:08.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate sum of positive elements of the matrix.\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":2920,"title":"Golden ratio","description":"Calculate the golden ratio. Hint: phi^2 = phi + 1.","description_html":"\u003cp\u003eCalculate the golden ratio. Hint: phi^2 = phi + 1.\u003c/p\u003e","function_template":"function phi = goldenRatio\r\n  phi = 1;\r\nend","test_suite":"%%\r\nphi_correct = (sqrt(5)+1)/2;\r\nerror_bound = 10^-12;\r\nassert(abs(goldenRatio() - phi_correct) \u003c= error_bound )\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":32231,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":180,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T23:50:24.000Z","updated_at":"2026-02-16T11:46:22.000Z","published_at":"2015-02-01T23:51:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the golden ratio. Hint: phi^2 = phi + 1.\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":46642,"title":"print 'Hello W0rld'","description":null,"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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eprint the text as shown\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 'Hello W0rld';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":573799,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":98,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-01T20:57:31.000Z","updated_at":"2026-02-13T18:13:47.000Z","published_at":"2020-10-01T20:57:31.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\u003eprint the text as shown\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":44807,"title":"Number Power","description":"Raise a number to itself. ","description_html":"\u003cp\u003eRaise a number to itself.\u003c/p\u003e","function_template":"function y = pwr(n)\r\n  y = ;\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 2;\r\ny_correct = 4;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 3;\r\ny_correct = 27;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 4;\r\ny_correct = 256;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 5;\r\ny_correct = 3125;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 9;\r\ny_correct = 387420489;\r\nassert(isequal(pwr(n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":269787,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":130,"test_suite_updated_at":"2018-11-29T20:49:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-11-29T20:44:14.000Z","updated_at":"2026-02-18T21:55:03.000Z","published_at":"2018-11-29T20:47:54.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRaise a number to itself.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44295,"title":"More Simple String Concatenation","description":"Take the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.","description_html":"\u003cp\u003eTake the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.\u003c/p\u003e","function_template":"function concat_str = your_fcn_name(str1, str2)\r\n  concat_str = ...;\r\nend","test_suite":"%%\r\nstr1 = 'apple';\r\nstr2 = 'pear';\r\nconcat_str = 'elppa pear';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one';\r\nstr2 = 'two';\r\nconcat_str = 'eno two';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one two';\r\nstr2 = 'three four';\r\nconcat_str = 'owt eno three four';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'hello';\r\nstr2 = 'there';\r\nconcat_str = 'olleh there';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'This is half a sentence;';\r\nstr2 = 'here is the other half.';\r\nconcat_str = ';ecnetnes a flah si sihT here is the other half.';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'left';\r\nstr2 = 'right';\r\nconcat_str = 'tfel right';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'right';\r\nstr2 = 'left';\r\nconcat_str = 'thgir left';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = ' leading space';\r\nstr2 = 'trailing space ';\r\nconcat_str = 'ecaps gnidael  trailing space ';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = '123';\r\nstr2 = '456';\r\nconcat_str = '321 456';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":76,"test_suite_updated_at":"2017-09-08T19:22:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:35:50.000Z","updated_at":"2026-03-02T17:20:07.000Z","published_at":"2017-09-06T00:35:50.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTake the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43171,"title":"Basic commands - Greatest common divisor","description":"Please write a function, which, will put as output greatest common divisor.\r\n\r\nExample:\r\n\r\n \r\n\r\n   A = [-5 17; \r\n         10 0];\r\n  \r\n    B = [-15 3; \r\n         100 0];\r\n  \r\n    Y = [ 5     1\r\n         10     0];","description_html":"\u003cp\u003ePlease write a function, which, will put as output greatest common divisor.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e   A = [-5 17; \r\n         10 0];\u003c/pre\u003e\u003cpre\u003e    B = [-15 3; \r\n         100 0];\u003c/pre\u003e\u003cpre\u003e    Y = [ 5     1\r\n         10     0];\u003c/pre\u003e","function_template":"function y = divi(a,b)\r\n  y = x;\r\nend","test_suite":"%%\r\n  A = [-5 17; 10 0];\r\n  B = [-15 3; 100 0];\r\n  y_correct = [ 5     1;\r\n               10     0];\r\nassert(isequal(divi(A,B),y_correct))\r\n\r\n\r\n%%\r\n  A = [24 39; 6 89];\r\n  B = [-18 169; 250 17];\r\n  y_correct = [ 6     13;\r\n                2     1];\r\nassert(isequal(divi(A,B),y_correct))","published":true,"deleted":false,"likes_count":24,"comments_count":0,"created_by":90955,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":205,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T17:09:21.000Z","updated_at":"2026-02-24T10:08:57.000Z","published_at":"2016-10-07T17:09:21.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease write a function, which, will put as output greatest common divisor.\u003c/w:t\u003e\u003c/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[   A = [-5 17; \\n         10 0];\\n\\n    B = [-15 3; \\n         100 0];\\n\\n    Y = [ 5     1\\n         10     0];]]\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":47643,"title":"Find the sum to n terms of an arithmetic progression of the type 2n+1.","description":null,"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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 25.5px; transform-origin: 407.5px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 199.875px 7.66667px; transform-origin: 199.875px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eExample: Sum the first 20 terms of the sequence: 1, 3, 5, 7, 9, ...\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 30.1583px 7.66667px; transform-origin: 30.1583px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eS20=400.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 3 5 7 9];\r\ny_correct = 25;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\nx = [1 3 5 7];\r\ny_correct = 16;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":727868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":47,"test_suite_updated_at":"2020-11-29T09:03:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-11-28T13:32:28.000Z","updated_at":"2026-02-08T17:50:50.000Z","published_at":"2020-11-28T13:32:28.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\u003eExample: Sum the first 20 terms of the sequence: 1, 3, 5, 7, 9, ...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eS20=400.\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":44736,"title":"Transpose the Matrix","description":"Transpose the given matrix, e.g. x=[a b;c d]\r\ntranspose of x = [a c;b d]","description_html":"\u003cp\u003eTranspose the given matrix, e.g. x=[a b;c d]\r\ntranspose of x = [a c;b d]\u003c/p\u003e","function_template":"function y = transposeit(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2;3 4]\r\ny_correct = [1 3;2 4]\r\nassert(isequal(transposeit(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":136465,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":99,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-09-04T08:27:38.000Z","updated_at":"2026-02-13T18:14:17.000Z","published_at":"2018-09-04T08:27:38.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTranspose the given matrix, e.g. x=[a b;c d] transpose of x = [a c;b d]\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":1046,"title":"Add two numbers","description":"Calculate the sum of two numbers.\r\n\r\nExample\r\n\r\n input  = [2 3]\r\n output =  5","description_html":"\u003cp\u003eCalculate the sum of two numbers.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e input  = [2 3]\r\n output =  5\u003c/pre\u003e","function_template":"function y = addup(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [2 3];\r\ny_correct = 5;\r\nassert(isequal(addup(x),y_correct))\r\n\r\n%%\r\nx = [-3 3];\r\ny_correct = 0;\r\nassert(isequal(addup(x),y_correct))\r\n\r\n%%\r\nx = [2.1 48];\r\ny_correct = 50.1;\r\nassert(isequal(addup(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":11,"comments_count":3,"created_by":6303,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1487,"test_suite_updated_at":"2013-07-11T15:49:18.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-11-21T13:35:24.000Z","updated_at":"2026-03-27T04:42:07.000Z","published_at":"2012-11-21T13:35: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\u003eCalculate the sum of two numbers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ input  = [2 3]\\n output =  5]]\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":2620,"title":"Determine the Anti-diagonal of a Magic Square","description":"Determine the anti-diagonal (crossing from top right to lower left) of a magic square of size n.\r\n\r\nExamples\r\n\r\nIf n = 3\r\n\r\n y = 6 5 4\r\n\r\nIf n = 4\r\n\r\n y = 13 10 7 4","description_html":"\u003cp\u003eDetermine the anti-diagonal (crossing from top right to lower left) of a magic square of size n.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cp\u003eIf n = 3\u003c/p\u003e\u003cpre\u003e y = 6 5 4\u003c/pre\u003e\u003cp\u003eIf n = 4\u003c/p\u003e\u003cpre\u003e y = 13 10 7 4\u003c/pre\u003e","function_template":"function y = other_diag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 3;\r\ny_correct = [6 5 4];\r\nassert(isequal(other_diag(x),y_correct))\r\n\r\n%%\r\nx = 4\r\ny_correct = [13 10 7 4];\r\nassert(isequal(other_diag(x),y_correct))\r\n\r\n%%\r\nx = 7;\r\ny_correct = [28 27 26 25 24 23 22];\r\nassert(isequal(other_diag(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":5,"created_by":30368,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":118,"test_suite_updated_at":"2015-01-27T08:02:04.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-10-06T17:58:43.000Z","updated_at":"2026-04-05T09:46:46.000Z","published_at":"2014-10-06T17:59:32.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine the anti-diagonal (crossing from top right to lower left) of a magic square of size n.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf n = 3\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[ y = 6 5 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\u003eIf n = 4\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[ y = 13 10 7 4]]\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":2376,"title":"Find the Nth Root of a Given Number","description":"Find the Nth root of a given number x.\r\n\r\nExamples\r\n\r\n x = 4096\r\n n = 4\r\n y = 8\r\n\r\n x = 625\r\n n = 5\r\n y = 3.6239","description_html":"\u003cp\u003eFind the Nth root of a given number x.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e x = 4096\r\n n = 4\r\n y = 8\u003c/pre\u003e\u003cpre\u003e x = 625\r\n n = 5\r\n y = 3.6239\u003c/pre\u003e","function_template":"function y = nth_root(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 4096;n=4;\r\ny_correct = 8;\r\n\r\nassert(isequal(nth_root(x,n),y_correct))\r\n\r\n%%\r\nx = 256;n=4;\r\ny_correct = 4;\r\n\r\nassert(isequal(nth_root(x,n),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":22553,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":364,"test_suite_updated_at":"2014-08-26T16:11:50.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-06-18T15:50:59.000Z","updated_at":"2026-03-23T11:17:06.000Z","published_at":"2014-06-18T15:52:17.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the Nth root of a given number x.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x = 4096\\n n = 4\\n y = 8\\n\\n x = 625\\n n = 5\\n y = 3.6239]]\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":44141,"title":"Determine whether the number is multiple of 3 or not","description":"Let a=6 and as 6 = 2*3 which means 6 is multiple of 3;\r\nreturn true if a is multiple of 3,otherwise false.","description_html":"\u003cp\u003eLet a=6 and as 6 = 2*3 which means 6 is multiple of 3;\r\nreturn true if a is multiple of 3,otherwise false.\u003c/p\u003e","function_template":"function y = multof3(x)\r\n  y = false;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = false;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 372;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 5;\r\ny_correct = false;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 42;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 41;\r\ny_correct = false;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 81;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 82;\r\ny_correct = false;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 33333333;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 369636963;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":131762,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":81,"test_suite_updated_at":"2017-05-04T13:55:00.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2017-04-28T21:24:16.000Z","updated_at":"2026-02-17T17:55:33.000Z","published_at":"2017-04-28T21:24:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLet a=6 and as 6 = 2*3 which means 6 is multiple of 3; return true if a is multiple of 3,otherwise false.\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":2353,"title":"Sum of the Matrix Elements","description":"Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\r\n\r\nExample : \r\n\r\nx=  [ 8     1     6]\r\n     \r\n \r\nThe total sum of the elements will be 8+1+6= 15.\r\n","description_html":"\u003cp\u003eAdd up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\u003c/p\u003e\u003cp\u003eExample :\u003c/p\u003e\u003cp\u003ex=  [ 8     1     6]\u003c/p\u003e\u003cp\u003eThe total sum of the elements will be 8+1+6= 15.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1];\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":2,"created_by":27280,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":601,"test_suite_updated_at":"2014-06-08T12:50:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-08T12:46:47.000Z","updated_at":"2026-02-05T19:39:47.000Z","published_at":"2014-06-08T12:50:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAdd up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample :\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\u003ex= [ 8 1 6]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe total sum of the elements will be 8+1+6= 15.\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":42940,"title":"modulus of a number","description":"find the modulus of a given number","description_html":"\u003cp\u003efind the modulus of a given number\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = abs(x);\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = -1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = -3;\r\ny_correct = 3;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":86789,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":232,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-09-01T21:06:06.000Z","updated_at":"2026-04-09T09:35:17.000Z","published_at":"2016-09-01T21:06:12.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efind the modulus of a given number\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":44264,"title":"Calculate feeling temperature before climbing a mountain","description":"I sometimes climb a mountain.\r\nAs is well known, when the altitude becomes 100 (m) higher, the temperature lowers by 0.6 degrees Celsius.\r\nIn addition there is wind.\r\nAt wind velocity 1(m/s), the feeling temperature falls  1 degree Celsius.\r\n\r\ne.g.\r\n\r\n* temperature of the level ground(gT) : 25 degrees Celsius\r\n* wind velocity(v) : 10 m/s\r\n* at altitude(h) : 3000 m\r\n\r\nIn this case, feeling temperature(fT) is calculated as -3 degrees Celsius.\r\n","description_html":"\u003cp\u003eI sometimes climb a mountain.\r\nAs is well known, when the altitude becomes 100 (m) higher, the temperature lowers by 0.6 degrees Celsius.\r\nIn addition there is wind.\r\nAt wind velocity 1(m/s), the feeling temperature falls  1 degree Celsius.\u003c/p\u003e\u003cp\u003ee.g.\u003c/p\u003e\u003cul\u003e\u003cli\u003etemperature of the level ground(gT) : 25 degrees Celsius\u003c/li\u003e\u003cli\u003ewind velocity(v) : 10 m/s\u003c/li\u003e\u003cli\u003eat altitude(h) : 3000 m\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eIn this case, feeling temperature(fT) is calculated as -3 degrees Celsius.\u003c/p\u003e","function_template":"function fT =  feeling_temperature(gT,h,v)\r\n  fT = gT;\r\nend","test_suite":"%%\r\ngT=25;\r\nh=3000;\r\nv=10;\r\n\r\nfT_correct = -3;\r\nassert(isequal(feeling_temperature(gT,h,v),fT_correct))\r\n\r\n%%\r\ngT=30;\r\nh=500;\r\nv=0;\r\n\r\nfT_correct=27;\r\nassert(isequal(feeling_temperature(gT,h,v),fT_correct))\r\n\r\n%%\r\ngT=28;\r\nh=2500;\r\nv=3;\r\n\r\nfT_correct=10;\r\nassert(isequal(feeling_temperature(gT,h,v),fT_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":102298,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":70,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-07-16T14:13:00.000Z","updated_at":"2026-03-30T18:25:51.000Z","published_at":"2017-07-16T14:28:25.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 sometimes climb a mountain. As is well known, when the altitude becomes 100 (m) higher, the temperature lowers by 0.6 degrees Celsius. In addition there is wind. At wind velocity 1(m/s), the feeling temperature falls 1 degree Celsius.\u003c/w:t\u003e\u003c/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\u003ee.g.\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\u003etemperature of the level ground(gT) : 25 degrees Celsius\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\u003ewind velocity(v) : 10 m/s\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\u003eat altitude(h) : 3000 m\u003c/w:t\u003e\u003c/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\u003eIn this case, feeling temperature(fT) is calculated as -3 degrees Celsius.\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":44035,"title":"determine the sum of the squares","description":"if x = 4, the solution will be: y = 1^2+2^2+3^2+4^2=1+4+9+16 = 30.","description_html":"\u003cp\u003eif x = 4, the solution will be: y = 1^2+2^2+3^2+4^2=1+4+9+16 = 30.\u003c/p\u003e","function_template":"function y = sum_square(x)\r\n  y = 0;\r\nend","test_suite":"%%\r\nx = 4;\r\ny = 30;\r\nassert(isequal(sum_square(x),y))\r\n%%\r\nx = 6;\r\ny = 91;\r\nassert(isequal(sum_square(x),y))\r\n%%\r\nx = 5;\r\ny = 55;\r\nassert(isequal(sum_square(x),y))\r\n%%\r\nx = 15;\r\ny = 1240;\r\nassert(isequal(sum_square(x),y))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":108804,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":129,"test_suite_updated_at":"2017-01-22T22:33:23.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-01-22T22:14:42.000Z","updated_at":"2026-04-07T18:51:59.000Z","published_at":"2017-01-22T22:14:42.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eif x = 4, the solution will be: y = 1^2+2^2+3^2+4^2=1+4+9+16 = 30.\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":45936,"title":"Bit to Gigabyte","description":"1 bit =\r\n1.25 × 10^-10 gigabytes | x is bit | y is gigabyte","description_html":"\u003cp\u003e1 bit =\r\n1.25 × 10^-10 gigabytes | x is bit | y is gigabyte\u003c/p\u003e","function_template":"function y = bittogigabyte(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 14400000000;\r\ny_correct = 1.8;\r\nassert(isequal(bittogigabyte(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":5,"created_by":441903,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":173,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:23:02.000Z","updated_at":"2026-04-07T18:51:24.000Z","published_at":"2020-06-14T12:23:02.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e1 bit = 1.25 × 10^-10 gigabytes | x is bit | y is gigabyte\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":44678,"title":"Calculate time taken by light to reach earth surface","description":"We know the time(seconds) taken by light to reach surface of earth. What if the distance varies yearly or source of light moves from one planet to another? How the time(seconds) varies?\r\n","description_html":"\u003cp\u003eWe know the time(seconds) taken by light to reach surface of earth. What if the distance varies yearly or source of light moves from one planet to another? How the time(seconds) varies?\u003c/p\u003e","function_template":"function y= light_time(x)\r\n  \r\n  y=x;\r\n  \r\nend","test_suite":"%%\r\nx =150000000 ;\r\ny_correct = 500;\r\nassert(isequal(light_time(x),y_correct))\r\n%%\r\nx=1800000;\r\ny_correct = 6;\r\nassert(isequal(light_time(x),y_correct))\r\n%%\r\nx=300000;\r\ny_correct = 1;\r\nassert(isequal(light_time(x),y_correct))\r\n%%\r\nx=57909000;\r\ny_correct = 193;\r\nassert(isequal(light_time(x),y_correct))\r\n%%\r\nx=5790960000;\r\ny_correct = 1.9303e+04;\r\nassert(isequal(light_time(x),y_correct))\r\n\r\n\r\n\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":220577,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":49,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-06-07T09:16:16.000Z","updated_at":"2026-03-04T13:43:37.000Z","published_at":"2018-06-07T09:16:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe know the time(seconds) taken by light to reach surface of earth. What if the distance varies yearly or source of light moves from one planet to another? How the time(seconds) varies?\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":44473,"title":"Let's make puddings !","description":"We will make puddings with eggs, milk and sugar.\r\nTo make one pudding, we need one egg, 140(cc) of milk, 15 (g) of sugar.\r\nNow We have x eggs,  y (cc) of milk, z (g) of sugar.\r\nHow many puddings can we make?\r\n\r\neg. When we have 3 eggs, 300cc milk, 300g sugar...\r\n\r\ninput :  x = 3, y = 300, z = 300\r\n\r\noutput :  Puddings= 2","description_html":"\u003cp\u003eWe will make puddings with eggs, milk and sugar.\r\nTo make one pudding, we need one egg, 140(cc) of milk, 15 (g) of sugar.\r\nNow We have x eggs,  y (cc) of milk, z (g) of sugar.\r\nHow many puddings can we make?\u003c/p\u003e\u003cp\u003eeg. When we have 3 eggs, 300cc milk, 300g sugar...\u003c/p\u003e\u003cp\u003einput :  x = 3, y = 300, z = 300\u003c/p\u003e\u003cp\u003eoutput :  Puddings= 2\u003c/p\u003e","function_template":"function Puddings = Egg_Milk_Sugar(x,y,z)\r\n  Puddings = 100;\r\nend","test_suite":"%% 1\r\nx = 3;\r\ny = 300;\r\nz = 300;\r\nC = 2;\r\nassert(isequal(Egg_Milk_Sugar(x,y,z),C))\r\n%% 2 \r\nx = 0;\r\ny = 999;\r\nz = 999;\r\nC = 0;\r\nassert(isequal(Egg_Milk_Sugar(x,y,z),C))\r\n%% 3\r\nx = 12;\r\ny = 1000;\r\nz = 100;\r\nC = 6;\r\nassert(isequal(Egg_Milk_Sugar(x,y,z),C))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":137687,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":55,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-12-27T02:51:08.000Z","updated_at":"2026-02-05T15:36:08.000Z","published_at":"2017-12-27T03:32:17.000Z","restored_at":"2018-02-06T15:11:49.000Z","restored_by":null,"spam":false,"simulink":false,"admin_reviewed":true,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe will make puddings with eggs, milk and sugar. To make one pudding, we need one egg, 140(cc) of milk, 15 (g) of sugar. Now We have x eggs, y (cc) of milk, z (g) of sugar. How many puddings can we make?\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\u003eeg. When we have 3 eggs, 300cc milk, 300g sugar...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput : x = 3, y = 300, z = 300\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput : Puddings= 2\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":44634,"title":"Basic matrix operations using standard MATLAB commands","description":"Create the matrix:\r\n\r\n 1.0e+15 *\r\n\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0001    0.0010    0.0100    0.1000    1.0000\r\n\r\nFind the row vector of all column means\r\n\r\nHint: Use _logspace_ to create the matrix. Avoid looking at the test suite before writing a solution","description_html":"\u003cp\u003eCreate the matrix:\u003c/p\u003e\u003cpre\u003e 1.0e+15 *\u003c/pre\u003e\u003cpre\u003e    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0000    0.0000    0.0000    0.0000    0.0000\r\n    0.0001    0.0010    0.0100    0.1000    1.0000\u003c/pre\u003e\u003cp\u003eFind the row vector of all column means\u003c/p\u003e\u003cp\u003eHint: Use \u003ci\u003elogspace\u003c/i\u003e to create the matrix. Avoid looking at the test suite before writing a solution\u003c/p\u003e","function_template":"function y = matrix_ls_means()\r\n  y = x;\r\nend","test_suite":"%%\r\ny_correct = mean([logspace(1,5,5);logspace(6,10,5);logspace(11,15,5)]);\r\nassert(isequal(matrix_ls_means(),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":"2018-05-09T05:37:01.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-09T05:32:41.000Z","updated_at":"2026-02-17T08:19:25.000Z","published_at":"2018-05-09T05:35:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eCreate the matrix:\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[ 1.0e+15 *\\n\\n    0.0000    0.0000    0.0000    0.0000    0.0000\\n    0.0000    0.0000    0.0000    0.0000    0.0000\\n    0.0001    0.0010    0.0100    0.1000    1.0000]]\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\u003eFind the row vector of all column means\u003c/w:t\u003e\u003c/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: Use\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003elogspace\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to create the matrix. Avoid looking at the test suite before writing a solution\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":2121,"title":"Find offset of given matrix element from first matrix element","description":"Given matrix m and an element of that matrix, return the offset from its first element.\r\ne.g. m=[11 2 34; 40 51 6; 87 8 109]\r\nelement = 51\r\nThen, offset = 5\r\n\r\nReturn 0, if that element if not a matrix element","description_html":"\u003cp\u003eGiven matrix m and an element of that matrix, return the offset from its first element.\r\ne.g. m=[11 2 34; 40 51 6; 87 8 109]\r\nelement = 51\r\nThen, offset = 5\u003c/p\u003e\u003cp\u003eReturn 0, if that element if not a matrix element\u003c/p\u003e","function_template":"function offset= FindOffset(m, element)\r\n  y = x;\r\nend","test_suite":"%%\r\nm=[11 2 34; 40 51 6; 87 8 109]\r\nelement = 51;\r\noffset = 5;\r\nassert(isequal(FindOffset(m,element),offset));\r\n\r\n%%\r\nm=reshape([1:10],5,2);\r\nelement = 9;\r\noffset = 9;\r\nassert(isequal(FindOffset(m,element),offset));\r\n\r\n%%\r\nm=eye(7);\r\nelement = 0;\r\noffset = 2;\r\nassert(isequal(FindOffset(m,element),offset));\r\n\r\n%%\r\nm=[10 20 30 40; 50 60 70 80;];\r\nelement = 56;\r\noffset = 0;\r\nassert(isequal(FindOffset(m,element),offset));\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":16381,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":85,"test_suite_updated_at":"2014-01-15T19:28:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-01-15T19:21:32.000Z","updated_at":"2026-02-28T08:07:23.000Z","published_at":"2014-01-15T19:21:46.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven matrix m and an element of that matrix, return the offset from its first element. e.g. m=[11 2 34; 40 51 6; 87 8 109] element = 51 Then, offset = 5\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReturn 0, if that element if not a matrix element\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":44303,"title":"Find the sum of the largest two elements in a vector","description":"With this one, you have to find the two largest elements in a vector and output the sum of those numbers.","description_html":"\u003cp\u003eWith this one, you have to find the two largest elements in a vector and output the sum of those numbers.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5];\r\ny_correct = 9;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 1:100;\r\ny_correct = 199;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 100:-1:1;\r\ny_correct = 199;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = ones(1,10);\r\ny_correct = 2;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 2:2:10;\r\ny_correct = 18;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [561 13 3544 89 65 4615 561 32 8 958 65 69451];\r\ny_correct = 74066;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":116,"test_suite_updated_at":"2017-09-08T19:49:23.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T01:25:16.000Z","updated_at":"2026-02-15T10:34:07.000Z","published_at":"2017-09-06T01:25:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWith this one, you have to find the two largest elements in a vector and output the sum of those numbers.\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":2068,"title":"Determine the square root","description":"Determine the square root of the value the user has entered, n.","description_html":"\u003cp\u003eDetermine the square root of the value the user has entered, n.\u003c/p\u003e","function_template":"function y = your_fcn_name(n)\r\n  y = n;\r\nend","test_suite":"%%\r\nn = 4;\r\ny_correct = 2;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn = 16;\r\ny_correct = 4;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n%%\r\nn = 285156;\r\ny_correct = 534;\r\nassert(isequal(your_fcn_name(n),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":7,"comments_count":2,"created_by":21190,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":792,"test_suite_updated_at":"2014-01-14T22:26:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-12-20T14:22:47.000Z","updated_at":"2026-03-16T15:29:27.000Z","published_at":"2013-12-20T14:22:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine the square root of the value the user has entered, n.\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":56408,"title":"Zero or hero","description":"A number will be given as an input. You can be hero if it's not zero.\r\n(Just for fun)","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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 25.5px; transform-origin: 343px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eA number will be given as an input. You can be hero if it's not zero.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e(Just for fun)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 'Hero';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 0;\r\ny_correct = 'Zero';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 'Hero';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 10;\r\ny_correct = 'Hero';\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":589324,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-10-23T03:54:31.000Z","updated_at":"2026-02-15T11:01:40.000Z","published_at":"2022-10-23T03:54:31.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA number will be given as an input. You can be hero if it's not zero.\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(Just for fun)\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":45927,"title":"GPA","description":"Math's credit is 5 and you got x | Physics's credit 7 and you got y what is your GPA ","description_html":"\u003cp\u003eMath's credit is 5 and you got x | Physics's credit 7 and you got y what is your GPA\u003c/p\u003e","function_template":"function z = gpa(x,y)\r\n  z = x and y;\r\nend","test_suite":"%%\r\nx = 75;\r\ny = 81;\r\nz_correct = 78.5;\r\nassert(isequal(gpa(x,y),z_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":441903,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":115,"test_suite_updated_at":"2020-06-14T12:04:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:00:53.000Z","updated_at":"2026-02-15T11:17:42.000Z","published_at":"2020-06-14T12:04:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMath's credit is 5 and you got x | Physics's credit 7 and you got y what is your GPA\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":45933,"title":"Watt","description":"Ampere x Volt = Watt","description_html":"\u003cp\u003eAmpere x Volt = Watt\u003c/p\u003e","function_template":"function y = watt(A,V)\r\n  y = A and V;\r\nend","test_suite":"%%\r\nV = 24;\r\nA = 15;\r\ny_correct = 360;\r\nassert(isequal(watt(A,V),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":441903,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":112,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:17:37.000Z","updated_at":"2026-02-15T11:18:17.000Z","published_at":"2020-06-14T12:17:37.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAmpere x Volt = Watt\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":45930,"title":"Mile to Kilometer","description":"x is mile and y is km","description_html":"\u003cp\u003ex is mile and y is km\u003c/p\u003e","function_template":"function y = miletokm(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 100;\r\ny_correct = 160.9344;\r\nassert(isequal(miletokm(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":441903,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":170,"test_suite_updated_at":"2020-06-14T12:07:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:06:46.000Z","updated_at":"2026-03-22T02:39:40.000Z","published_at":"2020-06-14T12:07:50.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex is mile and y is km\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":1801,"title":"03 - Matrix Variables 5","description":"Make the following variable:\r\n\r\n\u003c\u003chttp://samle.dk/STTBDP/Assignment1_3e.png\u003e\u003e\r\n","description_html":"\u003cp\u003eMake the following variable:\u003c/p\u003e\u003cimg src = \"http://samle.dk/STTBDP/Assignment1_3e.png\"\u003e","function_template":"function eMat = MatrixFunc()\r\n  *Insert code here\r\nend","test_suite":"%%\r\nref = [13 -1 5;-22 10 -87];\r\nuser = MatrixFunc();\r\nassert(isequal(user,ref))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":15468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":632,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-13T14:06:57.000Z","updated_at":"2026-02-09T13:43:25.000Z","published_at":"2013-08-13T14:06:57.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"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\u003eMake the following variable:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOUAAABLCAIAAAAAvdffAAALj0lEQVR42u2de1wTVxbHJzFijVpowQIfRQWUWqi6aMVtEbVWQBd3cdH1AWqVtRpfsXat7C5akVbxsRp5bXf56KpVgVLqA8tD+KhQRUV80lILEkkFETAEMREJSYadR0ImT8BMEpDz+0snQO7MfOfcc8499wzSBgL1HCFwCUDAKwgEvIKAV7gEIOAVBAJeQcArXAIQ8AoCAa8g4BUuAQh47UZSSPNCnVmIppjMGenlLXD7ravaPC6boXVnENfJvMdo7+Y1zI1z6wUKfHR/Pecn+vkBr13mtbkk92Bs7JZZHsM3HRPofCqvLj66dKojZgwYDI8VURk1MuufppifmxDL2zTf83dzjzVZ8NkU3Yge0UdtJBkMz5isGuDVkrxKcnas2Lx/F0Gkkw6vckFuTMSBQjHa1tpY9OUCLwTpP52TIbaq+W688a8lq2N2rJ1qgyCW5bUumetNnc0Hj95S3gr21Qr+gCQn+n1dXltF+UknShWq/0qfpAbaM/uy55+vs76NJU2dJXnFTj/Ia911IW3nDrzSzKuYf+teg/r2oPKi9eNsGYzxSdee9T5em68m/nnOlkIF+K/dllctkbyOmsar7gYurIV5Jc8d8wHcfDkHYlNKG2TAazfnFfNlN7q7L8kpf94dztSyvOLnPoSJUCItj7WEWw+8dk9em+9mRUywNSkc7un+K+7QNxYfjtsya9RA05MDwKu5eEXl5fGLvVSWxT54XXqNrJfyqpIwLyEMM7eQH+jO/oAwPyWKMC324by7CtqHjkoe8SuMiV9LPS2r8qq8YiaGnsCreeMtTM/KE31smSbaFUPZokB7JmJYWnk0a/NKDqDjKwa8WpPXtraq+EUjzMFrj/IHlA/YTHuwrz2BVytS0q3sq9sgk5ZOgFez84obFcfAtHvWT2lZm9e6ZO5kE/144PWleSVXxrV4JZOODn/kHLh8HwdUzM/aPD9g87F7CuufqDIhaile8VmFxfaNOJBN5EaEeQlLAxYcMTFPAry+VL0LblmpUlMr5p8OJyqzMGF3a/P+JBLc7mBZqSM2P7VE+vl1MhzsP2nuP49m3zf9oQVeof61Jwl4BV6BVwoMj67ELwzydsD3mzB9Qr/VNwc1Xdg/eyA+WfV3HROSVFAPvIKsaV/b63T07bxRPL7+1Rhik47d8A13JFYIS2TivSNtPE89BV57gEQFYba2IT8rzMlrU8mut1k4ka/ZrtIyYzJxAWfCG+RajP+GXGlXMHt4JTW3VAL2FewrvbxKixJnO7i6OTERnTJ70ZlIv7GBs7zxKHJoZFp152H9rfArH6eQnOpW4BV4fUleZZKHl84ejYtNTM35tVn9Fyv3hXiG74wKtGdqbpJW1BR+4Tn848OHVr3B0EUZw+jJzXPH4mLjD6fffCTIP5hw5PpvLYRJLj8Zv3KsPcvBg3ux7GGTFAVegdeu8iq5c3ar3yif9XuS0+KWOjKHR6Y9VFpXfMn49wevngx1xnwC15gsIXm85UnWYi+vyLSSM5ETMW/AfQqvRu2UoE3802tnjvkwbNfZgkvf7w71cnuLZROMWVNUUXZg+Udj3TEXgvmWq/fkyfOOai9GS588NF6zVCmUyIHX3syr5GbyJy79xsZkVqPK1LQd5+tfSRgEmatd8FKPe9umD1bn1dHHJ7g+H4SlNMhu/83HDkHYf4kuVo0BfVpxYs7b9jNWZzQplEMcb8NwHhf9QGl/ybK0UTFZdUZiO8PSXkEFXnsVr61lZ9e59GUHbsh5jmL3vnRXiFu/N+dlPiDn/cb0TROmcjJbUHx1DkEGLeP9jE3p/HOfjRy2LP+RVFKR+F5/BrUmUiYu3OA72HbYJ4V1rZRwrX+watsaqsARtxm0+JJIDvks4LVrvL6oTQ8e8Vofm6CMB8+FFZkRczxdxiw5cbUOVVs7dyKQakzmvoMZNz9O1nOlJ1CJtsnLUhfbIMgAR84NMUljU3b0FCZit5xXohqS9NahEBbFmrY8/mba60yvoEMimgADXnsPr82XeAFYbM92mhT0hw98A8L3Hf6xrgWlZrJGs4OJKF56PTEI43VcSHTMx17vh6WIcD4fJy0biR2cGJomQUnf8+SfnG2osReq+CXK35FyhECcMShs9y0DYwb/FXg1KCz2d0EQx1W8whqRVG8mSxVIKU0p3uHDY901Yq6XN19Y7sHGDnAPVZDkVJ4K78eglmLIKn5Y68ikRmPCZO67RvZUgP8KvBoRHkVRo37i9gtultRjfxBFy2NmD2v3O8lec8w+yrCsTVU0xGT5f1dGOrtKG4z5DDJ1DgGDD3deXzTcKbwrUsgurxrNxv2HZ7X5P1x7RgdjwGvv4RULp7wxnj7inBTibkCLoPj4mgXrs8vE2Gfi+4kTBw7ffrq2/ZvG2wxoj/pVrip10Utpg92n7BW0yIQVGRsXrv4ywp/FcF6z/3+fL9xwvrKFXCp7b9F/s//96c5TAloQA157UbwlbSjYOH0IZhQHOHlO9PLwm7ezUCDBDt/L3RMy0QlB+o72WxmXdvtFW1vr01Mh49YTnoCi7m7qP1bPHNoXX6Rl9vUM27Q7+7YIR6flZuSMoWQDVlef9XlljbcPzcGYtndfRj4D9QWfv8nEjPQ7f//mF7o2SAOvvSqfhS9rXTmXlpKec720XsUQ2iyqag9wBLXKaEoikap+pZZvIAZSSGuLL57LvXC3gYjbFNKqK3lXq56pIiRUdCc/9/JtOnfzA6+9i9eeLpp4bS45F9/e8/WvW49rtYsS83NjiHaWRLH91jNFtJVNGm3sio0qhuytwmL7fnGkyPJtPSknjti5zd17XD0GQ8GxkXgaeKWlnrD5Vkr4EM1OANQeb2L+idkeA6mfstj07EA02tgVH5XLQN+YDHwjCjEGOwt3oiV6Lzgs2HqR+FKyQZND+5ZD3V06HfaItUQ94SvPa6soa/G700gs2hvvUBJn+L5QVUsieXVxAmnwaNxBpXfjKzaqsNF2wZR2lviPsSzZ2VO38QK+lq46gv07RGcnJvYrI4MNt+AEXk3nVV72bcRujTZm5IZE5Rqy9Ml3a7kaVo3Ei8YOGvp4xZMt/TQnVnL+tXA/TV1eVas/NWeT87WMfYcNNYBX03lt/ul8gWYASC7CKXkV83+8orlFluwjZGZecdumU6Wp96D5RFYmUXsS4ubTsE+CXzdno5cFeDXHfhiSV4OtNEhezeoP6LNtbbR0XOu6/8rEQj3CWcJbEPjP4xluXNyBMwC8mpFXI3bC9DZSHfJqwIR3vocSbZei6toOogvBIDe3Scb7FXfmsgCv9OdfMdvGHe//n8J6w7OkvypkfuV5baOWjti5GWk1jv/YgAEd+CqQzzLOq7yptrJL1V7ESyYWrjDcJQqbIgMCaH6dgeV51Vnx0ZZqkQjPlnhP4z2ov0a82skIsvjYOvSRgFfjvJJl5p2v9sKmv/0btxu0na2iS5Fr9vzUQHO40yVe6fBf1SbTkIjB4B27hvZp/zphZrS/jWZmWjOZMKLDBwl4pdMfEPNTudzjhhaLUXn5159GmOPdG4byAzq8WjQ/QMZ8GtXM8tKoAGe9D0wnW20Cr7Tx2irK4ixK0LQczQ8qHqkcg7qUz1ZqrWlJBBW1MjPxav38q7535RlySDrlDACvtPGqb6KXVxXF7Ushb4wwa8fGJM0IDPuV7du+pwUdw+tbQ6j9VmnPS3Qk3JxrWlP9Br6TzgDwSg+vmm+D0X19gJ7qAr07HV7amzTQ2BU/3l4/QLzMdqxl6weUySz3yduIJ1lZP6CbG+l8323g1XReddvBavRYNVTVQYsf2VFjV3XVGKV1sCUlry5O2TTfE9FXn0W9gJ1c7QNeof61Jwl4BV6BV+AVBLwCryDgFXgFXoFXEPBqPl5DnVlaySbNVrUg64jssaIlfW8V6E28gl4lAa8g4BUEAl5BIOAVBLyCQMArCAS8gnqS/g+84HIYNkbRxgAAAABJRU5ErkJggg==\"}]}"},{"id":52148,"title":"MATLAB Basics: Complex Argument","description":"For a given complex number, x, return the argument, y, in degrees.","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: 20px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.493px 10px; transform-origin: 406.493px 10px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 383.49px 10px; text-align: left; transform-origin: 383.498px 10px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor a given complex number, x, return the argument, y, in degrees.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = argumentdeg(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1+i;\r\ny_correct = 45;\r\nassert(isequal(argumentdeg(x),y_correct))\r\n%%\r\nx = 45i;\r\ny_correct = 90;\r\nassert(isequal(argumentdeg(x),y_correct))\r\n%%\r\nx = 136;\r\ny_correct = 0;\r\nassert(isequal(argumentdeg(x),y_correct))\r\n%%\r\nx = 17-6i;\r\ny_correct = -(atan(6/17)*180/pi)\r\nassert(abs(argumentdeg(x)-y_correct)\u003c0.001)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":1231855,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":69,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-28T14:26:52.000Z","updated_at":"2026-03-30T20:49:34.000Z","published_at":"2021-06-28T14:28:37.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\u003eFor a given complex number, x, return the argument, y, in degrees.\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":44546,"title":"Calculating the total earnings of a factory","description":"The row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.","description_html":"\u003cp\u003eThe row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.\u003c/p\u003e","function_template":"function earn = earnings(rate, price)\r\n    earn= (); % use your basic knowledge of matrix multiplication\r\nend","test_suite":"%%\r\nrate = [2,5,4];\r\nprice = [8,3,1];\r\ny_correct = 3360;\r\nassert(isequal(earnings(rate,price),3360))\r\n%%\r\nrate = [1,4];\r\nprice = [2,1];\r\ny_correct = 576;\r\nassert(isequal(earnings(rate,price),576))\r\n%%\r\nrate = [6 6 2 3 2 8];\r\nprice = [3 2 4 8 9 5];\r\ny_correct = 11520;\r\nassert(isequal(earnings(rate,price),11520))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":57,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-03-31T09:16:35.000Z","updated_at":"2026-02-11T11:25:03.000Z","published_at":"2018-03-31T09:16:35.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe row vector, prods contains the number of various products manufactured per hour. The second row vector, prices holds values for the corresponding item prices they sell the given product for. Given the factory generates operates on a 6-day work week and two 8-hour long shifts per day, find the total earnings.\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":52133,"title":"MATLAB Basics: Complex Conjugates","description":"For a given complex number, x, return the complex conjugate, y.","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 200.5px 8px; transform-origin: 200.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor a given complex number, x, return the complex conjugate, y.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = compconj(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1+i;\r\ny_correct = 1-i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 1-i;\r\ny_correct = 1+i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 3i;\r\ny_correct = -3i;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 7;\r\ny_correct = 7;\r\nassert(isequal(compconj(x),y_correct))\r\n%%\r\nx = 7-13i;\r\ny_correct = 7+13i;\r\nassert(isequal(compconj(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":1231855,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":"2021-06-28T19:38:20.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-28T14:07:04.000Z","updated_at":"2026-02-11T18:32:04.000Z","published_at":"2021-06-28T14:07:36.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\u003eFor a given complex number, x, return the complex conjugate, y.\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":43319,"title":"Select primes from the matrix.","description":"Select primes from the matrix.","description_html":"\u003cp\u003eSelect primes from the matrix.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = magic(4);\r\ny_correct = [5\r\n     2\r\n    11\r\n     7\r\n     3\r\n    13];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = magic(5);\r\ny_correct = [17\r\n    23\r\n    11\r\n     5\r\n     7\r\n    13\r\n    19\r\n     2\r\n     3];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":98,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T17:01:20.000Z","updated_at":"2026-02-08T05:38:44.000Z","published_at":"2016-10-10T17:01:20.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSelect primes from the matrix.\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":43980,"title":"Find the binary code","description":"Given a sinusoidal signal, create a function that returns the binary code of a quantized value. The function takes the bit length and quantized value as the input.\r\n\r\n  Bit length = 3\r\n  Quantized value  = 2\r\n  Binary code      = 010\r\n","description_html":"\u003cp\u003eGiven a sinusoidal signal, create a function that returns the binary code of a quantized value. The function takes the bit length and quantized value as the input.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eBit length = 3\r\nQuantized value  = 2\r\nBinary code      = 010\r\n\u003c/pre\u003e","function_template":"function y = binaryCode(bitLen,quantizedValue)\r\n    \r\n  y = quantizedValue;  %Complete this function\r\n  \r\nend","test_suite":"%%\r\nnumBit = 2;\r\nanalogValue =1;\r\nbinary=binaryCode(numBit,analogValue);\r\nbinary_correct= '01';\r\nassert(isequal(binary,binary_correct))\r\n\r\n%%\r\nnumBit = 4;\r\nanalogValue =15;\r\nbinary=binaryCode(numBit,analogValue);\r\nbinary_correct= '1111';\r\nassert(isequal(binary,binary_correct))\r\n\r\n%%\r\nnumBit = 6;\r\nanalogValue =63;\r\nbinary=binaryCode(numBit,analogValue);\r\nbinary_correct= '111111';\r\nassert(isequal(binary,binary_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":107998,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":"2016-12-29T17:24:48.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2016-12-29T16:48:24.000Z","updated_at":"2026-02-11T14:09:51.000Z","published_at":"2016-12-29T17:10:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a sinusoidal signal, create a function that returns the binary code of a quantized value. The function takes the bit length and quantized value as the input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Bit length = 3\\nQuantized value  = 2\\nBinary code      = 010]]\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":45909,"title":"Convert Angstrom to Meters","description":"Write a code that converts the angstrom unit to meters.(A is angstrom and m is meters.)","description_html":"\u003cp\u003eWrite a code that converts the angstrom unit to meters.(A is angstrom and m is meters.)\u003c/p\u003e","function_template":"function m = conv_fcn_met(A)\r\n  m = ;\r\nend","test_suite":"%%\r\nA = 1;\r\nm_correct = 10^-10;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n%%\r\nA = 0;\r\nm_correct = 0;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n%%\r\nA = 10;\r\nm_correct = 10^-9;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n%%\r\nA = 400;\r\nm_correct = 4*10^-8 ;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n%%\r\nA = 30000;\r\nm_correct = 3*10^-6;\r\nassert(isequal(conv_fcn_met(A),m_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":444624,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":102,"test_suite_updated_at":"2020-06-13T17:36:05.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-13T17:27:41.000Z","updated_at":"2026-02-06T10:07:54.000Z","published_at":"2020-06-13T17:27:39.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a code that converts the angstrom unit to meters.(A is angstrom and m is meters.)\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":43318,"title":"Compare two strings.","description":"Compare two strings, whether they are equal or not.","description_html":"\u003cp\u003eCompare two strings, whether they are equal or not.\u003c/p\u003e","function_template":"function z = Comparer(x,y)\r\n  z = x==y;\r\nend","test_suite":"%%\r\nx = 'When you finish the test, you will be told your approximate English level. You can then search for suitable content on LearnEnglish Teens by level. You can also search for content by topic.';\r\ny='When you finish the test, you will be told your approximate English level. You can then search for suitable content on LearnEnglish Teens by level. You can also search for content by topic.';\r\ny_correct = true;\r\nassert(isequal(Comparer(x,y),y_correct))\r\n%%\r\nx = 'When you finish tee test, you will be told your approximate English level. You can then search for suitable content on LearnEnglish Teens by level. You can also search for content by topic.';\r\ny='When you finish the test, you will be told your approximate English level. You can then search for suitable content on LearnEnglish Teens by level. You can also search for content by topic.';\r\ny_correct = false;\r\nassert(isequal(Comparer(x,y),y_correct))\r\n%%\r\nx='Hello';\r\ny='Hi';\r\ny_correct = false;\r\nassert(isequal(Comparer(x,y),y_correct))\r\n%%\r\nx='Hello';\r\ny='Hello';\r\ny_correct = true;\r\nassert(isequal(Comparer(x,y),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":106,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T16:05:56.000Z","updated_at":"2026-02-09T14:59:17.000Z","published_at":"2016-10-10T16:05:56.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCompare two strings, whether they are equal or not.\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":44670,"title":"Basic Quadratic Equation","description":"Create the equation:\r\n\r\ny=(3x)^2+(5x)+35\r\nand compute y for various values of x","description_html":"\u003cp\u003eCreate the equation:\u003c/p\u003e\u003cp\u003ey=(3x)^2+(5x)+35\r\nand compute y for various values of x\u003c/p\u003e","function_template":"function y = quad1(x)\r\n\r\nend","test_suite":"%%\r\nx = -3;\r\ny_correct = 101;\r\nassert(isequal(quad1(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 285;\r\nassert(isequal(quad1(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":171559,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":91,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-05-30T10:55:15.000Z","updated_at":"2026-02-13T15:28:08.000Z","published_at":"2018-05-30T10:55:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate the 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\u003ey=(3x)^2+(5x)+35 and compute y for various values of x\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":2104,"title":"construct matrix with identical rows","description":"Input a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x. \r\n\r\nExample \r\n\r\n L = 5\r\n\r\nThe resulting answer is:\r\n\r\n [1:10;\r\n  1:10;\r\n  1:10; \r\n  1:10;\r\n  1:10]\r\n\r\n","description_html":"\u003cp\u003eInput a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e L = 5\u003c/pre\u003e\u003cp\u003eThe resulting answer is:\u003c/p\u003e\u003cpre\u003e [1:10;\r\n  1:10;\r\n  1:10; \r\n  1:10;\r\n  1:10]\u003c/pre\u003e","function_template":"function c=consIdenticalRowMatrix(a,rows)\r\n%you code here\r\nend\r\n","test_suite":"%%\r\nx = [1:10];\r\ny_correct =[1:10;1:10];\r\nrows=2;\r\nassert(isequal(consIdenticalRowMatrix(x,rows),y_correct))\r\n\r\nx=1:5;\r\nrows=5;\r\ny_correct=[x;x;x;x;x];\r\nassert(isequal(consIdenticalRowMatrix(x,rows),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":9153,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":209,"test_suite_updated_at":"2014-06-25T08:39:31.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-01-11T10:17:53.000Z","updated_at":"2026-02-08T06:10:56.000Z","published_at":"2014-01-11T10:17:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eInput a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x.\u003c/w:t\u003e\u003c/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[ L = 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\u003eThe resulting answer 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[ [1:10;\\n  1:10;\\n  1:10; \\n  1:10;\\n  1:10]]]\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":46923,"title":"Half the length of the vector","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ex=[1 2 3 4 5 6 7 8]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ey=[1 3 5 7]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5 6 7 8];\r\ny_correct = [1 3 5 7];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [1.28 3.26 4.89 6.23 2.22];\r\ny_correct = [1.28 4.89 2.22];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17];\r\ny_correct = [1 3 5 7 9 11 13 15 17];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":628208,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-18T17:54:32.000Z","updated_at":"2026-02-12T19:00:53.000Z","published_at":"2020-10-18T17:54:32.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\u003ex=[1 2 3 4 5 6 7 8]\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\u003ey=[1 3 5 7]\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\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\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":43747,"title":"Find the distance traveled by a car given velocity and time.","description":"A car is traveling at a constant velocity for a specific amount of time. The function should use the two inputs, velocity and time, to find the distance traveled.","description_html":"\u003cp\u003eA car is traveling at a constant velocity for a specific amount of time. The function should use the two inputs, velocity and time, to find the distance traveled.\u003c/p\u003e","function_template":"function y = distance(velocity,time)\r\n  D = time;\r\nend","test_suite":"%%\r\nvelocity = 10;\r\ntime = 60; \r\nD_correct = 600;\r\nassert(isequal(distance(velocity,time),D_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":100857,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":130,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-07T20:05:40.000Z","updated_at":"2026-02-10T21:28:41.000Z","published_at":"2016-12-07T20:05:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA car is traveling at a constant velocity for a specific amount of time. The function should use the two inputs, velocity and time, to find the distance traveled.\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":3088,"title":"Compute LOG(1+X) in natural log ","description":"Compute LOG(1+X) in natural log \r\n\r\n","description_html":"\u003cp\u003eCompute LOG(1+X) in natural log\u003c/p\u003e","function_template":"function y = log1(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2;\r\ny_correct = 1.0986;\r\nassert( (log1(x)-y_correct)\u003c0.0001)\r\n%%\r\nx = 0;\r\ny_correct = 0;\r\nassert( (log1(x)-y_correct)\u003c0.0001)\r\n%%\r\nx = 1;\r\ny_correct = 0.6931;\r\nassert( (log1(x)-y_correct)\u003c0.0001)\r\n%%\r\nx = 9;\r\ny_correct = 2.3026;\r\nassert( (log1(x)-y_correct)\u003c0.0001)","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":264,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-03-17T05:14:16.000Z","updated_at":"2026-02-12T18:28:06.000Z","published_at":"2015-03-17T05:14:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCompute LOG(1+X) in natural log\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":53805,"title":"Find the summation, mean, median, mode and standard deviation of a given array.","description":"An array is given. Find out the summation, mean, median, mode and standard deviation of a given array.\r\nIf x=[1,2,2,3,3,3,4,4,4,4] \r\nthen the output will be\r\ny=[30.0000    3.0000    3.0000    4.0000    1.0541]","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAn array is given. Find out the summation, mean, median, mode and standard deviation of a given array.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIf x=[1,2,2,3,3,3,4,4,4,4] \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ethen the output will be\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ey=[\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003e30.0000    3.0000    3.0000    4.0000    1.0541\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1,2,2,3,3,3,4,4,4,4];\r\ny_correct = [30.0000    3.0000    3.0000    4.0000 std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 1:15;\r\ny_correct = [  120.0000    8.0000    8.0000    1.0000    std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = [1,2,3,3,3,5,5,5,5,5,4,4,4,5];\r\ny_correct = [54.0000    mean(x)   4.0000    5.0000   std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 1:15:120;\r\ny_correct = [428.0000   53.5000   53.5000    1.0000 std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx =-50:10:50;\r\ny_correct = [0         0         0  -50.0000 std(x)];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":1458699,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":64,"test_suite_updated_at":"2022-01-09T18:01:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-01-09T17:42:15.000Z","updated_at":"2026-02-06T18:13:58.000Z","published_at":"2022-01-09T17:42: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\u003eAn array is given. Find out the summation, mean, median, mode and standard deviation of a given array.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf x=[1,2,2,3,3,3,4,4,4,4] \u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen the output will be\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\u003ey=[\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e30.0000    3.0000    3.0000    4.0000    1.0541\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":2798,"title":"Beginner's Problem - Squaring","description":"Try out this test problem first.\r\n\r\nGiven the variable x as your input, square it by two and put the result in y.\r\n\r\nExamples:\r\n\r\n Input  x = 2\r\n Output y is 4\r\n\r\n Input  x = 10\r\n Output y is 100","description_html":"\u003cp\u003eTry out this test problem first.\u003c/p\u003e\u003cp\u003eGiven the variable x as your input, square it by two and put the result in y.\u003c/p\u003e\u003cp\u003eExamples:\u003c/p\u003e\u003cpre\u003e Input  x = 2\r\n Output y is 4\u003c/pre\u003e\u003cpre\u003e Input  x = 10\r\n Output y is 100\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 25;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":1,"created_by":33468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":844,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-24T14:46:57.000Z","updated_at":"2026-03-26T01:18:23.000Z","published_at":"2014-12-24T14:46:57.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eTry out this test problem first.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the variable x as your input, square it by two and put the result in y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ Input  x = 2\\n Output y is 4\\n\\n Input  x = 10\\n Output y is 100]]\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":2389,"title":"Max of a Vector","description":"Write a function to return the max of a vector","description_html":"\u003cp\u003eWrite a function to return the max of a vector\u003c/p\u003e","function_template":"function y = FindMax(x)\r\n  \r\nend","test_suite":"%%\r\nx = [10 20 30];\r\ny_correct = 30;\r\nassert(isequal(FindMax(x),  y_correct))\r\n\r\n%%\r\nx = [1 2 3 4 3 2 1];\r\ny_correct = 4;\r\nassert(isequal(FindMax(x),   y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":24594,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":721,"test_suite_updated_at":"2014-06-25T20:05:00.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-25T20:02:30.000Z","updated_at":"2026-03-29T23:34:58.000Z","published_at":"2014-06-25T20:02: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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function to return the max of a vector\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":2163,"title":"Evaluate Polynomial","description":"Given a polynomial equation coefficients in a vector p, you have to return its value at x.\r\n\r\nExample:\r\n\r\nFor inputs p and x\r\n\r\n p = [1 0 1]\r\n x = [1 4]\r\n\r\nOutput y is [1*1^2 + 1, 1*4^2 + 1] or \r\n\r\n y = [2 17]","description_html":"\u003cp\u003eGiven a polynomial equation coefficients in a vector p, you have to return its value at x.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cp\u003eFor inputs p and x\u003c/p\u003e\u003cpre\u003e p = [1 0 1]\r\n x = [1 4]\u003c/pre\u003e\u003cp\u003eOutput y is [1*1^2 + 1, 1*4^2 + 1] or\u003c/p\u003e\u003cpre\u003e y = [2 17]\u003c/pre\u003e","function_template":"function y = polynomial(p,x)\r\n  y = 0;\r\nend","test_suite":"%%\r\np = [1 0 -8 -7 5];\r\nx = [ 5 7 9 ];\r\ny_correct = [ 395  1965  5855];\r\nassert(isequal(polynomial(p,x),y_correct))\r\n\r\n%%\r\np = [1 0 -10 0 0 0 11 -50];\r\nx = [3 7 4 5];\r\ny_correct = [-260  655500  6138 46880]\r\nassert(isequal(polynomial(p,x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":11900,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":147,"test_suite_updated_at":"2014-02-07T15:58:46.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-02-07T05:50:19.000Z","updated_at":"2026-03-09T18:42:08.000Z","published_at":"2014-02-07T05:50:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a polynomial equation coefficients in a vector p, you have to return its value at x.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor inputs p and x\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[ p = [1 0 1]\\n x = [1 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\u003eOutput y is [1*1^2 + 1, 1*4^2 + 1] or\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[ y = [2 17]]]\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":45887,"title":"Which one is More bigger?","description":"we have two input like (x,y) our output (z) must wich one is bigger input.","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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 223.5px 8px; transform-origin: 223.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewe have two input like (x,y) our output (z) must wich one is bigger input.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = P45691(x,y)\r\n  \r\nend","test_suite":"%%\r\nx = 1;\r\ny = 0;\r\nz_correct=x\r\nassert(isequal(P45691(x,y),z_correct))\r\n\r\n\r\n%%\r\nx = -1;\r\ny = 0;\r\nz_correct=y\r\nassert(isequal(P45691(x,y),z_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":452148,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":"2021-06-19T09:33:47.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-10T23:21:22.000Z","updated_at":"2026-03-09T18:41:33.000Z","published_at":"2020-06-10T23:21:22.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\u003ewe have two input like (x,y) our output (z) must wich one is bigger input.\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":52105,"title":"MATLAB Basics: Complex Numbers","description":"For a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].","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: 20px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.493px 10px; transform-origin: 406.493px 10px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 383.49px 10px; text-align: left; transform-origin: 383.498px 10px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = realimaginary(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1+i;\r\ny_correct = [1 1];\r\nassert(isequal(realimaginary(x),y_correct))\r\n%%\r\nx = 1.6+sqrt(2)*i;\r\ny_correct = [1.6 sqrt(2)];\r\nassert(isequal(realimaginary(x),y_correct))\r\n%%\r\nx = pi+156.78i;\r\ny_correct = [pi 156.78];\r\nassert(isequal(realimaginary(x),y_correct))\r\n%%\r\nx = 6i;\r\ny_correct = [0 6];\r\nassert(isequal(realimaginary(x),y_correct))\r\n%%\r\nx = 160000000;\r\ny_correct = [160000000 0];\r\nassert(isequal(realimaginary(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":1231855,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":52,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-06-25T08:23:44.000Z","updated_at":"2026-02-05T18:22:06.000Z","published_at":"2021-06-25T08:30:31.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\u003eFor a given complex number, x, return the real and imaginary parts as a vector, y = [Real Imaginary].\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":2768,"title":"Union of two set decreasing order ","description":"Union of two set decreasing order \r\n\r\nSay, x=[1 2 5]\r\n\r\nand y=[5 7 8] \r\n\r\nthen answer must be [8 7 5 2 1] ","description_html":"\u003cp\u003eUnion of two set decreasing order\u003c/p\u003e\u003cp\u003eSay, x=[1 2 5]\u003c/p\u003e\u003cp\u003eand y=[5 7 8]\u003c/p\u003e\u003cp\u003ethen answer must be [8 7 5 2 1]\u003c/p\u003e","function_template":"function y = unique_x(x,y)\r\n  y = x;\r\nend","test_suite":"%%\r\n x=[1 2 5];\r\ny=[5 7 8];\r\ny_correct = [8 7 5 2 1];\r\nassert(isequal(unique_x(x,y),y_correct))\r\n\r\n%%\r\n x=[1];\r\ny=[1];\r\ny_correct = [1];\r\nassert(isequal(unique_x(x,y),y_correct))\r\n%%\r\n x=[10];\r\ny=[1];\r\ny_correct = [10 1];\r\nassert(isequal(unique_x(x,y),y_correct))\r\n%%\r\n x=[1 5 8];\r\ny=[2 4 6 4];\r\ny_correct = [8 6 5 4 2 1];\r\nassert(isequal(unique_x(x,y),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":131,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-09T09:40:24.000Z","updated_at":"2026-02-11T18:37:53.000Z","published_at":"2014-12-09T09:40:24.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eUnion of two set decreasing order\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\u003eSay, x=[1 2 5]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand y=[5 7 8]\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\u003ethen answer must be [8 7 5 2 1]\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":44255,"title":"Average of even-numbered columns","description":"Given a vector, find the average of even-numbered columns.\r\n\r\ne.g\r\n\r\nx　=　[ 4 6 8 9 1 2 7 ]\r\n\r\ny =　( 6 + 9 + 2 ) / 3\r\n","description_html":"\u003cp\u003eGiven a vector, find the average of even-numbered columns.\u003c/p\u003e\u003cp\u003ee.g\u003c/p\u003e\u003cp\u003ex　=　[ 4 6 8 9 1 2 7 ]\u003c/p\u003e\u003cp\u003ey =　( 6 + 9 + 2 ) / 3\u003c/p\u003e","function_template":"function y = Ave_evenC(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [4 6 8 9 1 2 7];\r\ny_correct = (6+9+2)/3;\r\nassert(isequal(Ave_evenC(x),y_correct))\r\n\r\n%%\r\nx=[1:9];\r\ny_correct =(2+4+6+8)/4;\r\nassert(isequal(Ave_evenC(x),y_correct))\r\n\r\n%%\r\nx=repmat([5 0],1,10);\r\ny_correct=0;\r\nassert(isequal(Ave_evenC(x),y_correct))\r\n\r\n%%\r\nx=ones(1,51);\r\ny_correct=1;\r\nassert(isequal(Ave_evenC(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":102298,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":78,"test_suite_updated_at":"2017-07-09T08:26:53.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-07-09T08:02:08.000Z","updated_at":"2026-02-20T08:48:02.000Z","published_at":"2017-07-09T08:26:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a vector, find the average of even-numbered columns.\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\u003ee.g\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\u003ex　=　[ 4 6 8 9 1 2 7 ]\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\u003ey =　( 6 + 9 + 2 ) / 3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44242,"title":"Replace Nan!","description":"Replace Nan in the given vector(v) with 9999.","description_html":"\u003cp\u003eReplace Nan in the given vector(v) with 9999.\u003c/p\u003e","function_template":"function y = ReplaceNan(v)\r\n  y = v;\r\nend","test_suite":"%%\r\nx=[1 2 3 0/0 4];\r\ny_correct = [1 2 3 9999 4];\r\nassert(isequal(ReplaceNan(x),y_correct))\r\n\r\n%%\r\nx=[5:9];\r\ny_correct =[5:9];\r\nassert(isequal(ReplaceNan(x),y_correct))\r\n\r\n%%\r\nx=repmat(0/0,1,10);\r\ny_correct = repmat(9999,1,10);\r\nassert(isequal(ReplaceNan(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":102298,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-06-27T13:30:08.000Z","updated_at":"2026-02-13T18:08:24.000Z","published_at":"2017-06-27T13:33:17.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReplace Nan in the given vector(v) with 9999.\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":2980,"title":"multiply by three","description":"\r\nGiven the variable x as your input, multiply it by 3 and put the result equal to y.\r\n\r\nExamples:\r\n Input  x = 2\r\n Output y is 6\r\n Input  x = 10\r\n Output y is 30\r\n","description_html":"\u003cp\u003eGiven the variable x as your input, multiply it by 3 and put the result equal to y.\u003c/p\u003e\u003cp\u003eExamples:\r\n Input  x = 2\r\n Output y is 6\r\n Input  x = 10\r\n Output y is 30\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 3;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":3,"created_by":33999,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1014,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-07T05:00:06.000Z","updated_at":"2026-02-13T06:54:43.000Z","published_at":"2015-02-07T05:00:06.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the variable x as your input, multiply it by 3 and put the result equal to y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples: Input x = 2 Output y is 6 Input x = 10 Output y is 30\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":43305,"title":"Sum positive elements of matrix.","description":"Calculate sum of positive elements of the matrix.","description_html":"\u003cp\u003eCalculate sum of positive elements of the matrix.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [-5     1     6;\r\n    -5     5    -5;\r\n     4     9     2];\r\ny_correct = 27;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [ -2     2    -2    13;\r\n     5    11    10     8;\r\n    -2     7    -2    12;\r\n     4    14    15     1];\r\n y_correct = 102;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":130,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-10T11:28:08.000Z","updated_at":"2026-02-11T18:40:58.000Z","published_at":"2016-10-10T11:28:08.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate sum of positive elements of the matrix.\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":2920,"title":"Golden ratio","description":"Calculate the golden ratio. Hint: phi^2 = phi + 1.","description_html":"\u003cp\u003eCalculate the golden ratio. Hint: phi^2 = phi + 1.\u003c/p\u003e","function_template":"function phi = goldenRatio\r\n  phi = 1;\r\nend","test_suite":"%%\r\nphi_correct = (sqrt(5)+1)/2;\r\nerror_bound = 10^-12;\r\nassert(abs(goldenRatio() - phi_correct) \u003c= error_bound )\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":32231,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":180,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T23:50:24.000Z","updated_at":"2026-02-16T11:46:22.000Z","published_at":"2015-02-01T23:51:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the golden ratio. Hint: phi^2 = phi + 1.\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":46642,"title":"print 'Hello W0rld'","description":null,"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: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eprint the text as shown\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 'Hello W0rld';\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":573799,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":98,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-01T20:57:31.000Z","updated_at":"2026-02-13T18:13:47.000Z","published_at":"2020-10-01T20:57:31.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\u003eprint the text as shown\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":44807,"title":"Number Power","description":"Raise a number to itself. ","description_html":"\u003cp\u003eRaise a number to itself.\u003c/p\u003e","function_template":"function y = pwr(n)\r\n  y = ;\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 2;\r\ny_correct = 4;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 3;\r\ny_correct = 27;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 4;\r\ny_correct = 256;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 5;\r\ny_correct = 3125;\r\nassert(isequal(pwr(n),y_correct))\r\n%%\r\nn = 9;\r\ny_correct = 387420489;\r\nassert(isequal(pwr(n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":269787,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":130,"test_suite_updated_at":"2018-11-29T20:49:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2018-11-29T20:44:14.000Z","updated_at":"2026-02-18T21:55:03.000Z","published_at":"2018-11-29T20:47:54.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eRaise a number to itself.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":44295,"title":"More Simple String Concatenation","description":"Take the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.","description_html":"\u003cp\u003eTake the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.\u003c/p\u003e","function_template":"function concat_str = your_fcn_name(str1, str2)\r\n  concat_str = ...;\r\nend","test_suite":"%%\r\nstr1 = 'apple';\r\nstr2 = 'pear';\r\nconcat_str = 'elppa pear';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one';\r\nstr2 = 'two';\r\nconcat_str = 'eno two';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one two';\r\nstr2 = 'three four';\r\nconcat_str = 'owt eno three four';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'hello';\r\nstr2 = 'there';\r\nconcat_str = 'olleh there';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'This is half a sentence;';\r\nstr2 = 'here is the other half.';\r\nconcat_str = ';ecnetnes a flah si sihT here is the other half.';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'left';\r\nstr2 = 'right';\r\nconcat_str = 'tfel right';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'right';\r\nstr2 = 'left';\r\nconcat_str = 'thgir left';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = ' leading space';\r\nstr2 = 'trailing space ';\r\nconcat_str = 'ecaps gnidael  trailing space ';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = '123';\r\nstr2 = '456';\r\nconcat_str = '321 456';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":76,"test_suite_updated_at":"2017-09-08T19:22:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:35:50.000Z","updated_at":"2026-03-02T17:20:07.000Z","published_at":"2017-09-06T00:35:50.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTake the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space and concatenate it to the second inputted string.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43171,"title":"Basic commands - Greatest common divisor","description":"Please write a function, which, will put as output greatest common divisor.\r\n\r\nExample:\r\n\r\n \r\n\r\n   A = [-5 17; \r\n         10 0];\r\n  \r\n    B = [-15 3; \r\n         100 0];\r\n  \r\n    Y = [ 5     1\r\n         10     0];","description_html":"\u003cp\u003ePlease write a function, which, will put as output greatest common divisor.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e   A = [-5 17; \r\n         10 0];\u003c/pre\u003e\u003cpre\u003e    B = [-15 3; \r\n         100 0];\u003c/pre\u003e\u003cpre\u003e    Y = [ 5     1\r\n         10     0];\u003c/pre\u003e","function_template":"function y = divi(a,b)\r\n  y = x;\r\nend","test_suite":"%%\r\n  A = [-5 17; 10 0];\r\n  B = [-15 3; 100 0];\r\n  y_correct = [ 5     1;\r\n               10     0];\r\nassert(isequal(divi(A,B),y_correct))\r\n\r\n\r\n%%\r\n  A = [24 39; 6 89];\r\n  B = [-18 169; 250 17];\r\n  y_correct = [ 6     13;\r\n                2     1];\r\nassert(isequal(divi(A,B),y_correct))","published":true,"deleted":false,"likes_count":24,"comments_count":0,"created_by":90955,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":205,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T17:09:21.000Z","updated_at":"2026-02-24T10:08:57.000Z","published_at":"2016-10-07T17:09:21.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease write a function, which, will put as output greatest common divisor.\u003c/w:t\u003e\u003c/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[   A = [-5 17; \\n         10 0];\\n\\n    B = [-15 3; \\n         100 0];\\n\\n    Y = [ 5     1\\n         10     0];]]\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":47643,"title":"Find the sum to n terms of an arithmetic progression of the type 2n+1.","description":null,"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: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 25.5px; transform-origin: 407.5px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 199.875px 7.66667px; transform-origin: 199.875px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eExample: Sum the first 20 terms of the sequence: 1, 3, 5, 7, 9, ...\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 30.1583px 7.66667px; transform-origin: 30.1583px 7.66667px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eS20=400.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 3 5 7 9];\r\ny_correct = 25;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\nx = [1 3 5 7];\r\ny_correct = 16;\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":727868,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":47,"test_suite_updated_at":"2020-11-29T09:03:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-11-28T13:32:28.000Z","updated_at":"2026-02-08T17:50:50.000Z","published_at":"2020-11-28T13:32:28.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\u003eExample: Sum the first 20 terms of the sequence: 1, 3, 5, 7, 9, ...\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eS20=400.\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":44736,"title":"Transpose the Matrix","description":"Transpose the given matrix, e.g. x=[a b;c d]\r\ntranspose of x = [a c;b d]","description_html":"\u003cp\u003eTranspose the given matrix, e.g. x=[a b;c d]\r\ntranspose of x = [a c;b d]\u003c/p\u003e","function_template":"function y = transposeit(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2;3 4]\r\ny_correct = [1 3;2 4]\r\nassert(isequal(transposeit(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":136465,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":99,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-09-04T08:27:38.000Z","updated_at":"2026-02-13T18:14:17.000Z","published_at":"2018-09-04T08:27:38.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTranspose the given matrix, e.g. x=[a b;c d] transpose of x = [a c;b d]\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":1046,"title":"Add two numbers","description":"Calculate the sum of two numbers.\r\n\r\nExample\r\n\r\n input  = [2 3]\r\n output =  5","description_html":"\u003cp\u003eCalculate the sum of two numbers.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e input  = [2 3]\r\n output =  5\u003c/pre\u003e","function_template":"function y = addup(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [2 3];\r\ny_correct = 5;\r\nassert(isequal(addup(x),y_correct))\r\n\r\n%%\r\nx = [-3 3];\r\ny_correct = 0;\r\nassert(isequal(addup(x),y_correct))\r\n\r\n%%\r\nx = [2.1 48];\r\ny_correct = 50.1;\r\nassert(isequal(addup(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":11,"comments_count":3,"created_by":6303,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1487,"test_suite_updated_at":"2013-07-11T15:49:18.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-11-21T13:35:24.000Z","updated_at":"2026-03-27T04:42:07.000Z","published_at":"2012-11-21T13:35: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\u003eCalculate the sum of two numbers.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ input  = [2 3]\\n output =  5]]\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":2620,"title":"Determine the Anti-diagonal of a Magic Square","description":"Determine the anti-diagonal (crossing from top right to lower left) of a magic square of size n.\r\n\r\nExamples\r\n\r\nIf n = 3\r\n\r\n y = 6 5 4\r\n\r\nIf n = 4\r\n\r\n y = 13 10 7 4","description_html":"\u003cp\u003eDetermine the anti-diagonal (crossing from top right to lower left) of a magic square of size n.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cp\u003eIf n = 3\u003c/p\u003e\u003cpre\u003e y = 6 5 4\u003c/pre\u003e\u003cp\u003eIf n = 4\u003c/p\u003e\u003cpre\u003e y = 13 10 7 4\u003c/pre\u003e","function_template":"function y = other_diag(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 3;\r\ny_correct = [6 5 4];\r\nassert(isequal(other_diag(x),y_correct))\r\n\r\n%%\r\nx = 4\r\ny_correct = [13 10 7 4];\r\nassert(isequal(other_diag(x),y_correct))\r\n\r\n%%\r\nx = 7;\r\ny_correct = [28 27 26 25 24 23 22];\r\nassert(isequal(other_diag(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":5,"created_by":30368,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":118,"test_suite_updated_at":"2015-01-27T08:02:04.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-10-06T17:58:43.000Z","updated_at":"2026-04-05T09:46:46.000Z","published_at":"2014-10-06T17:59:32.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eDetermine the anti-diagonal (crossing from top right to lower left) of a magic square of size n.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf n = 3\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[ y = 6 5 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\u003eIf n = 4\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[ y = 13 10 7 4]]\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":2376,"title":"Find the Nth Root of a Given Number","description":"Find the Nth root of a given number x.\r\n\r\nExamples\r\n\r\n x = 4096\r\n n = 4\r\n y = 8\r\n\r\n x = 625\r\n n = 5\r\n y = 3.6239","description_html":"\u003cp\u003eFind the Nth root of a given number x.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cpre\u003e x = 4096\r\n n = 4\r\n y = 8\u003c/pre\u003e\u003cpre\u003e x = 625\r\n n = 5\r\n y = 3.6239\u003c/pre\u003e","function_template":"function y = nth_root(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 4096;n=4;\r\ny_correct = 8;\r\n\r\nassert(isequal(nth_root(x,n),y_correct))\r\n\r\n%%\r\nx = 256;n=4;\r\ny_correct = 4;\r\n\r\nassert(isequal(nth_root(x,n),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":22553,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":364,"test_suite_updated_at":"2014-08-26T16:11:50.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-06-18T15:50:59.000Z","updated_at":"2026-03-23T11:17:06.000Z","published_at":"2014-06-18T15:52:17.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFind the Nth root of a given number x.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x = 4096\\n n = 4\\n y = 8\\n\\n x = 625\\n n = 5\\n y = 3.6239]]\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":44141,"title":"Determine whether the number is multiple of 3 or not","description":"Let a=6 and as 6 = 2*3 which means 6 is multiple of 3;\r\nreturn true if a is multiple of 3,otherwise false.","description_html":"\u003cp\u003eLet a=6 and as 6 = 2*3 which means 6 is multiple of 3;\r\nreturn true if a is multiple of 3,otherwise false.\u003c/p\u003e","function_template":"function y = multof3(x)\r\n  y = false;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = false;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 372;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 5;\r\ny_correct = false;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 42;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 41;\r\ny_correct = false;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 81;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 82;\r\ny_correct = false;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 33333333;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))\r\n%%\r\nx = 369636963;\r\ny_correct = true;\r\nassert(isequal(multof3(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":131762,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":81,"test_suite_updated_at":"2017-05-04T13:55:00.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2017-04-28T21:24:16.000Z","updated_at":"2026-02-17T17:55:33.000Z","published_at":"2017-04-28T21:24:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLet a=6 and as 6 = 2*3 which means 6 is multiple of 3; return true if a is multiple of 3,otherwise false.\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":2353,"title":"Sum of the Matrix Elements","description":"Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\r\n\r\nExample : \r\n\r\nx=  [ 8     1     6]\r\n     \r\n \r\nThe total sum of the elements will be 8+1+6= 15.\r\n","description_html":"\u003cp\u003eAdd up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\u003c/p\u003e\u003cp\u003eExample :\u003c/p\u003e\u003cp\u003ex=  [ 8     1     6]\u003c/p\u003e\u003cp\u003eThe total sum of the elements will be 8+1+6= 15.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1];\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":2,"created_by":27280,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":601,"test_suite_updated_at":"2014-06-08T12:50:40.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-08T12:46:47.000Z","updated_at":"2026-02-05T19:39:47.000Z","published_at":"2014-06-08T12:50:40.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAdd up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample :\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\u003ex= [ 8 1 6]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe total sum of the elements will be 8+1+6= 15.\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:\"basic matlab\"","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:\"basic matlab\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"basic matlab\"","","\"","basic matlab","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007fe649c34740\u003e":null,"#\u003cMathWorks::Search::Field:0x00007fe649c346a0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007fe649c33980\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007fe649c34a60\u003e":1,"#\u003cMathWorks::Search::Field:0x00007fe649c349c0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007fe649c34920\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007fe649c347e0\u003e":"tag:\"basic matlab\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007fe649c347e0\u003e":"tag:\"basic matlab\""},"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":"cody-search","password":"78X075ddcV44","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:\"basic matlab\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"basic matlab\"","","\"","basic matlab","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007fe649c34740\u003e":null,"#\u003cMathWorks::Search::Field:0x00007fe649c346a0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007fe649c33980\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007fe649c34a60\u003e":1,"#\u003cMathWorks::Search::Field:0x00007fe649c349c0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007fe649c34920\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007fe649c347e0\u003e":"tag:\"basic matlab\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007fe649c347e0\u003e":"tag:\"basic matlab\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":42940,"difficulty_rating":"easy"},{"id":44264,"difficulty_rating":"easy"},{"id":44035,"difficulty_rating":"easy"},{"id":45936,"difficulty_rating":"easy"},{"id":44678,"difficulty_rating":"easy"},{"id":44473,"difficulty_rating":"easy"},{"id":44634,"difficulty_rating":"easy"},{"id":2121,"difficulty_rating":"easy"},{"id":44303,"difficulty_rating":"easy"},{"id":2068,"difficulty_rating":"easy"},{"id":56408,"difficulty_rating":"easy"},{"id":45927,"difficulty_rating":"easy"},{"id":45933,"difficulty_rating":"easy"},{"id":45930,"difficulty_rating":"easy"},{"id":1801,"difficulty_rating":"easy"},{"id":52148,"difficulty_rating":"easy"},{"id":44546,"difficulty_rating":"easy"},{"id":52133,"difficulty_rating":"easy"},{"id":43319,"difficulty_rating":"easy"},{"id":43980,"difficulty_rating":"easy"},{"id":45909,"difficulty_rating":"easy"},{"id":43318,"difficulty_rating":"easy"},{"id":44670,"difficulty_rating":"easy"},{"id":2104,"difficulty_rating":"easy"},{"id":46923,"difficulty_rating":"easy"},{"id":43747,"difficulty_rating":"easy"},{"id":3088,"difficulty_rating":"easy"},{"id":53805,"difficulty_rating":"easy"},{"id":2798,"difficulty_rating":"easy"},{"id":2389,"difficulty_rating":"easy"},{"id":2163,"difficulty_rating":"easy"},{"id":45887,"difficulty_rating":"easy"},{"id":52105,"difficulty_rating":"easy"},{"id":2768,"difficulty_rating":"easy"},{"id":44255,"difficulty_rating":"easy"},{"id":44242,"difficulty_rating":"easy"},{"id":2980,"difficulty_rating":"easy"},{"id":43305,"difficulty_rating":"easy"},{"id":2920,"difficulty_rating":"easy"},{"id":46642,"difficulty_rating":"easy"},{"id":44807,"difficulty_rating":"easy"},{"id":44295,"difficulty_rating":"easy"},{"id":43171,"difficulty_rating":"easy"},{"id":47643,"difficulty_rating":"easy"},{"id":44736,"difficulty_rating":"easy"},{"id":1046,"difficulty_rating":"easy"},{"id":2620,"difficulty_rating":"easy"},{"id":2376,"difficulty_rating":"easy"},{"id":44141,"difficulty_rating":"easy"},{"id":2353,"difficulty_rating":"easy"}]}}