{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":42526,"title":"Initialize a Natural Number matrix.","description":"Given length of matrix initialize a matrix consisting of natural numbers from 1 to n:\r\n\r\nn = 10;\r\nx = [ 1 2 3 4 5 6 7 8 9 10];\r\n\r\nn = 5;\r\nx = [1 2 3 4 5];","description_html":"\u003cp\u003eGiven length of matrix initialize a matrix consisting of natural numbers from 1 to n:\u003c/p\u003e\u003cp\u003en = 10;\r\nx = [ 1 2 3 4 5 6 7 8 9 10];\u003c/p\u003e\u003cp\u003en = 5;\r\nx = [1 2 3 4 5];\u003c/p\u003e","function_template":"function y = naturalNumbers(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(naturalNumbers(x),y_correct))\r\n\r\n%%\r\nx = 3;\r\ny_correct = [1 2 3];\r\nassert(isequal(naturalNumbers(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":48756,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":124,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-22T17:20:10.000Z","updated_at":"2026-04-02T18:59:44.000Z","published_at":"2015-08-22T17:24:03.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 length of matrix initialize a matrix consisting of natural numbers from 1 to 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 10; x = [ 1 2 3 4 5 6 7 8 9 10];\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\u003en = 5; x = [1 2 3 4 5];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43621,"title":"Get derivarive of polynomial given as vector array.","description":"Get derivarive of polynomial given as vector array.\r\n\r\nExample  \r\n\r\np=[ 1     2     0     5     0     3 ];\r\n\r\nresult=[ 5 8 0 10 0 ];","description_html":"\u003cp\u003eGet derivarive of polynomial given as vector array.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cp\u003ep=[ 1     2     0     5     0     3 ];\u003c/p\u003e\u003cp\u003eresult=[ 5 8 0 10 0 ];\u003c/p\u003e","function_template":"function y = PolyPol(x)\r\n  y = x;\r\nend","test_suite":"%%\r\np = [ 1     2     0     5     0     3 ];\r\ny_correct = [ 5 8 0 10 0 ];\r\nassert(isequal(PolyPol(p),y_correct))\r\n%%\r\np = [ 3     2     5     1     0     2];\r\ny_correct = [ 15     8    15     2     0 ];\r\nassert(isequal(PolyPol(p),y_correct))\r\n%%\r\np = [ 15     8    15     2     0 ];\r\ny_correct = [  60    24    30     2 ];\r\nassert(isequal(PolyPol(p),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":83,"test_suite_updated_at":"2016-10-25T09:14:14.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-25T09:10:39.000Z","updated_at":"2026-03-22T02:28:51.000Z","published_at":"2016-10-25T09:14:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eGet derivarive of polynomial given as vector 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\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\u003ep=[ 1 2 0 5 0 3 ];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eresult=[ 5 8 0 10 0 ];\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":172,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:23:02.000Z","updated_at":"2026-03-31T13:29:11.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":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":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":42500,"title":"replace empty matrices with '[]' ","description":"for example\r\n\r\n  a=1;a(:,1)=[]; returns \r\n  a =\r\n     Empty matrix: 1-by-0\r\n  use this as the input,and the output should be '[]'\r\n\r\n\r\n*require no appearance of '[]' and 'empty' method inside the function*","description_html":"\u003cp\u003efor example\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea=1;a(:,1)=[]; returns \r\na =\r\n   Empty matrix: 1-by-0\r\nuse this as the input,and the output should be '[]'\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003erequire no appearance of '[]' and 'empty' method inside the function\u003c/b\u003e\u003c/p\u003e","function_template":"function y = funny(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = int8.empty(3,0);\r\ny_correct = [];\r\nassert(isequal(funny(x),y_correct))\r\n\r\n%%\r\ntext=fileread('funny.m');\r\nassert(isempty(strfind(text,'[]')))\r\nassert(isempty(strfind(text,'empty')))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":40597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2015-08-09T06:13:58.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-09T06:07:51.000Z","updated_at":"2026-02-09T13:42:48.000Z","published_at":"2015-08-09T06:07:51.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\u003efor example\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=1;a(:,1)=[]; returns \\na =\\n   Empty matrix: 1-by-0\\nuse this as the input,and the output should be '[]']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003erequire no appearance of '[]' and 'empty' method inside the function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1791,"title":"02 - Vector Variables 1","description":"Make the following variable:\r\n\r\n\u003c\u003chttp://samle.dk/STTBDP/Assignment1_2a.png\u003e\u003e","description_html":"\u003cp\u003eMake the following variable:\u003c/p\u003e\u003cimg src = \"http://samle.dk/STTBDP/Assignment1_2a.png\"\u003e","function_template":"function aVec = VectorFunc()\r\n  *Insert code here\r\nend","test_suite":"%%\r\naVec = [3.14 15 9 26];\r\na = VectorFunc();\r\nassert(isequal(a,aVec))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":15468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":721,"test_suite_updated_at":"2013-08-27T09:52:03.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-13T13:23:08.000Z","updated_at":"2026-03-05T09:24:53.000Z","published_at":"2013-08-13T13:23: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\",\"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,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\"}]}"},{"id":44493,"title":"The great 82-year-old","description":"Let's answer the question below;\r\n\r\n'I am *x* years old and I have never written programs.\r\nIf I study from now, will I be able to develop programs?'\r\n\r\ninput *x* (years old) \u003e\u003e\u003e output 'Yes' or 'No'","description_html":"\u003cp\u003eLet's answer the question below;\u003c/p\u003e\u003cp\u003e'I am \u003cb\u003ex\u003c/b\u003e years old and I have never written programs.\r\nIf I study from now, will I be able to develop programs?'\u003c/p\u003e\u003cp\u003einput \u003cb\u003ex\u003c/b\u003e (years old) \u0026gt;\u0026gt;\u0026gt; output 'Yes' or 'No'\u003c/p\u003e","function_template":"function Answer = Age(x)\r\n  Answer = 'Yes';\r\nend","test_suite":"%%\r\nx = 20;\r\ny_correct = 'Yes';\r\nassert(isequal(Age(x),y_correct))\r\n%%\r\nx = 40;\r\ny_correct = 'Yes';\r\nassert(isequal(Age(x),y_correct))\r\n%% Great Ms Masako Wakamiya\r\nx = 82-1;\r\ny_correct = 'Yes';\r\nassert(isequal(Age(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":137687,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":152,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-01-08T12:47:36.000Z","updated_at":"2026-02-15T11:10:56.000Z","published_at":"2018-01-08T12:58:55.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\u003eLet's answer the question below;\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\u003e'I am\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e years old and I have never written programs. If I study from now, will I be able to develop programs?'\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\u003einput\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (years old) \u0026gt;\u0026gt;\u0026gt; output 'Yes' or 'No'\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":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":43691,"title":"determine if ","description":"determine if the elements of a matrix is a nan and return true","description_html":"\u003cp\u003edetermine if the elements of a matrix is a nan and return true\u003c/p\u003e","function_template":"function y = my_function(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [1 0 5 nan];\r\ny_correct = [0 0 0 1]\r\nassert(isequal(my_function(x),y_correct))\r\n%%\r\nx = [nan 1; 5 nan];\r\ny_correct = [1 0;0 1]\r\nassert(isequal(my_function(x),y_correct))\r\n%%\r\nx = [nan nan nan;nan nan nan];\r\ny_correct = [1 1 1;1 1 1]\r\nassert(isequal(my_function(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":88437,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":102,"test_suite_updated_at":"2016-11-28T02:45:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-11-28T02:42:32.000Z","updated_at":"2026-02-11T18:28:36.000Z","published_at":"2016-11-28T02:42: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\",\"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 if the elements of a matrix is a nan and return true\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":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":44326,"title":"Replace 0 indices in array with 1's","description":"Take a incoming vector, and replace 0's with ones","description_html":"\u003cp\u003eTake a incoming vector, and replace 0's with ones\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx = -1:1:3\r\ny_correct = [-1 1 1 2 3];\r\nassert(isequal(your_fcn_name(x),y_correct))\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":143,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-14T17:22:35.000Z","updated_at":"2026-02-09T17:09:04.000Z","published_at":"2017-09-14T17:22: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\u003eTake a incoming vector, and replace 0's with ones\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":43887,"title":"Radians to Degrees","description":"Convert radians to degrees.","description_html":"\u003cp\u003eConvert radians to degrees.\u003c/p\u003e","function_template":"function D = RAD2DEG(R)\r\n;\r\nend","test_suite":"%%\r\nR = pi/2;\r\nD_correct =90;\r\nassert(isequal(RAD2DEG(R),D_correct))\r\n\r\n%%\r\nR = pi;\r\nD_correct = 180;\r\nassert(isequal(RAD2DEG(R),D_correct))\r\n\r\n%%\r\nR = 2*pi;\r\nD_correct = 360;\r\nassert(isequal(RAD2DEG(R),D_correct))\r\n\r\n%%\r\nR = 3*pi;\r\nD_correct = 540;\r\nassert(isequal(RAD2DEG(R),D_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":100606,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":201,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-20T17:14:04.000Z","updated_at":"2026-02-08T05:40:37.000Z","published_at":"2016-12-20T17:14:04.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConvert radians to degrees.\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":47113,"title":"Distance Travelled by Vehicle","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: 101.2px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 50.6px; transform-origin: 407px 50.6px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 41.6px; 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 20.8px; text-align: left; transform-origin: 384px 20.8px; 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=\"\"\u003eGiven a vehicle travelling at a velocity of 10m/s and having a constant acceleration of 5m/s^2, write a function that gives the distance travelled by the vehicle in time t.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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=\"\"\u003eUnits of distance is m and time sec.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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=\"\"\u003eHint:  Remember Newton\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function dist = d_in_t(t)\r\n  dist = t;\r\nend","test_suite":"%%\r\nt = 1;\r\ny_correct = 12.5;\r\nassert(isequal(d_in_t(t),y_correct))\r\n%%\r\nt = 5;\r\ny_correct = 112.5;\r\nassert(isequal(d_in_t(t),y_correct))\r\n%%\r\nt = 10;\r\ny_correct = 350;\r\nassert(isequal(d_in_t(t),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":511890,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-28T08:21:47.000Z","updated_at":"2026-02-05T15:52:02.000Z","published_at":"2020-10-28T08:21:47.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\u003eGiven a vehicle travelling at a velocity of 10m/s and having a constant acceleration of 5m/s^2, write a function that gives the distance travelled by the vehicle in time t.\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\u003eUnits of distance is m and time sec.\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\u003eHint:  Remember Newton\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":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":44300,"title":"Matrix Generation from Vector Multiplication","description":"Output the matrix generated from multiplying two vectors together","description_html":"\u003cp\u003eOutput the matrix generated from multiplying two vectors together\u003c/p\u003e","function_template":"function out_matrix = your_fcn_name(x,y)\r\n  out_matrix = ...;\r\nend","test_suite":"%%\r\nx = [1; 2];\r\ny = [1 2];\r\nout_matrix = [1 2; 2 4];\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = (1:3)';\r\ny = 1:3;\r\nout_matrix = [1,2,3;2,4,6;3,6,9];\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = ones(10,1);\r\ny = ones(1,10);\r\nout_matrix = ones(10);\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = ones(1,10);\r\ny = ones(10,1);\r\nout_matrix = 10;\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = ones(3,1);\r\ny = [7 6 8];\r\nout_matrix = repmat(y,[3,1]);\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = [1;0;1;0;1];\r\ny = [0,1,0,1,0];\r\nout_matrix = [0,1,0,1,0;0,0,0,0,0;0,1,0,1,0;0,0,0,0,0;0,1,0,1,0];\r\nassert(isequal(your_fcn_name(x,y),out_matrix))","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":95,"test_suite_updated_at":"2017-09-08T19:39:11.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T01:11:33.000Z","updated_at":"2026-02-11T18:40:07.000Z","published_at":"2017-09-06T01:11:33.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\u003eOutput the matrix generated from multiplying two vectors together\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":44092,"title":"Find the minimal value in N*N Matrix","description":"Suppose that we have N by N matrix, we try to find the minimal value in that matrix.\r\nexamples:\r\nInput  A=[1 2 3 5 6;52 58 56 45 9;100 52 896 25 47; 52 325 6 2 1;1 1 1 1 2]\r\nOutput B=1\r\n\r\nInput  A=[1 0 3]\r\nOutput B=0  ","description_html":"\u003cp\u003eSuppose that we have N by N matrix, we try to find the minimal value in that matrix.\r\nexamples:\r\nInput  A=[1 2 3 5 6;52 58 56 45 9;100 52 896 25 47; 52 325 6 2 1;1 1 1 1 2]\r\nOutput B=1\u003c/p\u003e\u003cp\u003eInput  A=[1 0 3]\r\nOutput B=0\u003c/p\u003e","function_template":"function B = Min_Val(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nA =[100 200 2 5 0.1];\r\nB_correct = 0.1;\r\nassert(isequal(Min_Val(A),B_correct))\r\n%%\r\nA =[10 3 2; 5 0 1;7 8 2];\r\nB_correct = 0;\r\nassert(isequal(Min_Val(A),B_correct))\r\n%%\r\nA =1;\r\nB_correct =A;\r\nassert(isequal(Min_Val(A),B_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":37163,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":116,"test_suite_updated_at":"2017-04-12T11:39:10.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-04-12T11:30:20.000Z","updated_at":"2026-02-11T18:39:27.000Z","published_at":"2017-04-12T11:39:10.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\u003eSuppose that we have N by N matrix, we try to find the minimal value in that matrix. examples: Input A=[1 2 3 5 6;52 58 56 45 9;100 52 896 25 47; 52 325 6 2 1;1 1 1 1 2] Output B=1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput A=[1 0 3] Output B=0\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":44235,"title":"Shift elements of vector left","description":"Shift elements of vector to the left.\r\nFor ex. : Input_vec = [1 2 3 4 5]\r\nOutput_vec = [2 3 4 5 1]\r\n","description_html":"\u003cp\u003eShift elements of vector to the left.\r\nFor ex. : Input_vec = [1 2 3 4 5]\r\nOutput_vec = [2 3 4 5 1]\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5];\r\ny_correct = [2 3 4 5 1];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [10 56 98 -10];\r\ny_correct = [56 98 -10 10];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 'Matlab';\r\ny_correct = 'atlabM';\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","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":137674,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":111,"test_suite_updated_at":"2017-06-14T10:15:22.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2017-06-14T09:55:53.000Z","updated_at":"2026-02-11T18:39:52.000Z","published_at":"2017-06-14T09:56:18.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eShift elements of vector to the left. For ex. : Input_vec = [1 2 3 4 5] Output_vec = [2 3 4 5 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":2880,"title":"Matlab Basics II - Determine if an array has a 3rd dimension","description":"For an array A, determine whether it has 3 dimensions, return 0 if x is only 2D, and 1 if x is 3D","description_html":"\u003cp\u003eFor an array A, determine whether it has 3 dimensions, return 0 if x is only 2D, and 1 if x is 3D\u003c/p\u003e","function_template":"function y = three_d(x)\r\n  \r\nend","test_suite":"%%\r\nx(:,:,1) = [1 2 3];\r\nx(:,:,2) = [4 5 6];\r\nx(:,:,3) = [7 8 9];\r\ny_correct = 1;\r\nassert(isequal(three_d(x),y_correct))\r\n%%\r\nx(:,1) = [4 7 38];\r\nx(:,2) = [42 45 6];\r\ny_correct = 0;\r\nassert(isequal(three_d(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":167,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-27T19:39:36.000Z","updated_at":"2026-02-11T18:33:22.000Z","published_at":"2015-02-02T05:23: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\",\"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\u003eFor an array A, determine whether it has 3 dimensions, return 0 if x is only 2D, and 1 if x is 3D\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":54860,"title":"Create a column vector of n elements between a and b (both included)","description":"Given lower limit a and an upper limit b, create a column vector of n elements inclusive of a and b.\r\nFor example: a = 1, b = 4, n = 4  \r\n                      y = [1;2;3;4];","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.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=\"\"\u003eGiven lower limit a and an upper limit b, create a \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-weight: 700; \"\u003ecolumn\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 vector of n elements inclusive of a and b.\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=\"\"\u003eFor example: a = 1, b = 4, n = 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=\"\"\u003e                      y = [1;2;3;4];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(a, b, n)\r\n    \r\nend","test_suite":"%%\r\na = 1;\r\nb = 1;\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(a, b, n),y_correct))\r\n\r\n%%\r\na = 1;\r\nb = 10;\r\nn = 3;\r\ny_correct = [1; 5.5; 10];\r\nassert(isequal(your_fcn_name(a, b, n),y_correct))\r\n\r\n%%\r\na = 2;\r\nb = 10;\r\nn = 5;\r\ny_correct = [2;4;6;8;10];\r\nassert(isequal(your_fcn_name(a, b, n),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":2436220,"edited_by":2436220,"edited_at":"2022-07-12T14:26:21.000Z","deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":"2022-07-12T14:26:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-07-12T14:20:07.000Z","updated_at":"2026-03-09T18:48:18.000Z","published_at":"2022-07-12T14:26:21.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven lower limit a and an upper limit b, create a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecolumn\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e vector of n elements inclusive of a and b.\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\u003eFor example: a = 1, b = 4, n = 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\u003e                      y = [1;2;3;4];\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":44294,"title":"Simple String Concatenation","description":"This is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.","description_html":"\u003cp\u003eThis is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.\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 = 'apple pear';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one';\r\nstr2 = 'two';\r\nconcat_str = 'one 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 = 'one two 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 = 'hello 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 = 'This is half a sentence; 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 = 'left right';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'right';\r\nstr2 = 'left';\r\nconcat_str = 'right 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 = ' leading space 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 = '123 456';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":86,"test_suite_updated_at":"2017-09-08T19:18:15.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:32:01.000Z","updated_at":"2026-03-02T17:19:15.000Z","published_at":"2017-09-06T00:32:01.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\u003eThis is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.\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":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":43689,"title":"Make an identity matrix whose diagonal elements are 1:n","description":"For a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5:\r\n\r\n output = [1 0 0 0 0;\r\n           0 2 0 0 0;\r\n           0 0 3 0 0;\r\n           0 0 0 4 0;\r\n           0 0 0 0 5]\r\n","description_html":"\u003cp\u003eFor a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5:\u003c/p\u003e\u003cpre\u003e output = [1 0 0 0 0;\r\n           0 2 0 0 0;\r\n           0 0 3 0 0;\r\n           0 0 0 4 0;\r\n           0 0 0 0 5]\u003c/pre\u003e","function_template":"function y = special_eye(n)\r\n  y = n\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 2;\r\ny_correct = [1 0;0 2]\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 3;\r\ny_correct = [1 0 0;0 2 0;0 0 3]\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 4;\r\ny_correct = [1 0 0 0;0 2 0 0;0 0 3 0;0 0 0 4]\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 5;\r\ny_correct = [1 0 0 0 0;0 2 0 0 0;0 0 3 0 0; 0 0 0 4 0; 0 0 0 0 5]\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 6;\r\ny_correct = [1 0 0 0 0 0;0 2 0 0 0 0;0 0 3 0 0 0; 0 0 0 4 0 0; 0 0 0 0 5 0; 0 0 0 0 0 6]\r\nassert(isequal(special_eye(n),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":88437,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":123,"test_suite_updated_at":"2016-12-21T21:19:59.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-11-28T02:38:35.000Z","updated_at":"2026-02-10T22:03:12.000Z","published_at":"2016-11-28T02:38: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\",\"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\u003eFor a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5:\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[ output = [1 0 0 0 0;\\n           0 2 0 0 0;\\n           0 0 3 0 0;\\n           0 0 0 4 0;\\n           0 0 0 0 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":43617,"title":"Calculate the values of a polynomial.","description":"Calculate the values of a polynomial.Input parameter p - vector of polynomial coefficients, x - matrix of the argument values.\r\n\r\nExample \r\n\r\np=[-1 1]\r\n\r\nx=[1 2;3 4]\r\n\r\nresult=[ 0 -1; -2 -3]","description_html":"\u003cp\u003eCalculate the values of a polynomial.Input parameter p - vector of polynomial coefficients, x - matrix of the argument values.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cp\u003ep=[-1 1]\u003c/p\u003e\u003cp\u003ex=[1 2;3 4]\u003c/p\u003e\u003cp\u003eresult=[ 0 -1; -2 -3]\u003c/p\u003e","function_template":"function y = SolvePoly(p,x)\r\n  y = x;\r\nend","test_suite":"%%\r\np=[-1 1]\r\nx=[1 2;3 4]\r\ny_correct=[ 0 -1; -2 -3]\r\nassert(isequal(SolvePoly(p,x),y_correct))\r\n%%\r\np=[-2     0     1    -1     3     2]\r\nx=[5 6 11; 2 13 7; 4 9 21]\r\ny_correct=[-6133      -15352     -320857;\r\n           -52        -740517    -33297;\r\n           -1986      -117421    -8159317]\r\nassert(isequal(SolvePoly(p,x),y_correct))       ","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":90467,"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":"2016-10-24T22:55:06.000Z","updated_at":"2026-02-25T20:49:54.000Z","published_at":"2016-10-24T22:55: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\u003eCalculate the values of a polynomial.Input parameter p - vector of polynomial coefficients, x - matrix of the argument values.\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\u003ep=[-1 1]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex=[1 2;3 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\u003eresult=[ 0 -1; -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":1449,"title":"Saving MATLAB session to a file","description":"How to save MATLAB session to a file?","description_html":"\u003cp\u003eHow to save MATLAB session to a file?\u003c/p\u003e","function_template":"function y = your_fcn_name\r\n  y = 'guess';\r\nend","test_suite":"%%\r\ny_correct = 'diary';\r\nassert(isequal(your_fcn_name,y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":10792,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":201,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-04-23T10:23:52.000Z","updated_at":"2026-02-05T16:25:33.000Z","published_at":"2013-04-23T10:23:52.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\u003eHow to save MATLAB session to a file?\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":43737,"title":"Alternative Dimensions","description":"Given a multidimensional matrix, transform the matrix so the dimensions are in the order given by variable ord. For example, given the following matrix:\r\n\r\nm has 3 dimensions\r\n\r\n  m(1,:,:) = all 1s\r\n  m(2,:,:) = all 2s\r\n  m(3,:,:) = all 3s\r\n\r\nAfter the transformation to [3 2 1], the matrix should be:\r\n\r\n  m(:,:,1) = all 1s\r\n  m(:,:,2) = all 2s\r\n  m(:,:,3) = all 3s","description_html":"\u003cp\u003eGiven a multidimensional matrix, transform the matrix so the dimensions are in the order given by variable ord. For example, given the following matrix:\u003c/p\u003e\u003cp\u003em has 3 dimensions\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003em(1,:,:) = all 1s\r\nm(2,:,:) = all 2s\r\nm(3,:,:) = all 3s\r\n\u003c/pre\u003e\u003cp\u003eAfter the transformation to [3 2 1], the matrix should be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003em(:,:,1) = all 1s\r\nm(:,:,2) = all 2s\r\nm(:,:,3) = all 3s\r\n\u003c/pre\u003e","function_template":"function y = transform(M,ord)\r\n  y = x;\r\nend","test_suite":"%%\r\nM=ones(3,3,3);\r\nM(2,:,:)=2.*M(2,:,:);\r\nM(3,:,:)=3.*M(3,:,:);\r\nord = [3,2,1];\r\nMC = ones(3,3,3);\r\nMC(:,:,2)=2.*MC(:,:,2);\r\nMC(:,:,3)=3.*MC(:,:,3);\r\nassert(isequal(transform(M,ord),MC))\r\n%%\r\nM=rand(1,2,3,4,5,6);\r\nord = [6 1 5 2 4 3];\r\nassert(isequal(size(transform(M,ord)),ord))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":93456,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-06T23:42:04.000Z","updated_at":"2026-02-19T15:41:13.000Z","published_at":"2016-12-06T23:42:04.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a multidimensional matrix, transform the matrix so the dimensions are in the order given by variable ord. For example, given the following matrix:\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\u003em has 3 dimensions\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[m(1,:,:) = all 1s\\nm(2,:,:) = all 2s\\nm(3,:,:) = all 3s]]\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\u003eAfter the transformation to [3 2 1], the matrix should be:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[m(:,:,1) = all 1s\\nm(:,:,2) = all 2s\\nm(:,:,3) = all 3s]]\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":2924,"title":"Matlab Basics II - Operations and Matrix Dimensions","description":"Write a function that takes two inputs, a \u0026 b, and outputs the sum and product of the two matrices. The matrices have OPPOSITE dimensions: if, for example, a is 3x2, then b is 2x3. Round your answers to two decimal places.","description_html":"\u003cp\u003eWrite a function that takes two inputs, a \u0026 b, and outputs the sum and product of the two matrices. The matrices have OPPOSITE dimensions: if, for example, a is 3x2, then b is 2x3. Round your answers to two decimal places.\u003c/p\u003e","function_template":"function out = add_mult(a,b)\r\n  x =\r\n  y = \r\n  out = [{x},{y}];\r\nend","test_suite":"%%\r\na = [1 -2 7];\r\nb = [2;6;-1];\r\nout = [{[3.00 4.00 6.00]},{-17.00}];\r\nassert(isequal(add_mult(a,b),out))\r\n\r\n%%\r\na = [0.2922 0.1557 0.3491; 0.4595 -0.4643 0.4340];\r\nb = [0.4572 -0.3581; -0.0146 -0.0782; 0.3003 0.4157];\r\nout = [{[0.75 0.14 0.65; 0.1 -0.54 0.85]},{[0.24 0.03; 0.35 0.05]}];\r\nassert(isequal(add_mult(a,b),out))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":101,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-02T03:29:51.000Z","updated_at":"2026-02-12T18:14:36.000Z","published_at":"2015-02-02T05:28:43.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 that takes two inputs, a \u0026amp; b, and outputs the sum and product of the two matrices. The matrices have OPPOSITE dimensions: if, for example, a is 3x2, then b is 2x3. Round your answers to two decimal places.\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":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":46763,"title":"Double 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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.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]\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 0 2 0 3 0 4 0]\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=\"\"\u003eAdd zeros in between the data\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function double= your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [5 4 3 2];\r\ny_correct = [5 0 4 0 3 0 2 0];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx= [1 2 3 4];\r\ny_correct=[1 0 2 0 3 0 4 0];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":628208,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":50,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-16T15:49:54.000Z","updated_at":"2026-02-12T19:01:30.000Z","published_at":"2020-10-16T15:57:17.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]\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 0 2 0 3 0 4 0]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAdd zeros in between the data\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":2862,"title":"Matlab Basics - Pick out parts of a vector","description":"Consider x a vector of length \u003e= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, as well as elements 5-7 and places them in a vector y in reverse order, for example:\r\n\r\nx = [1 2 3 4 5 6 7] --\u003e y = [5 6 7 2]","description_html":"\u003cp\u003eConsider x a vector of length \u0026gt;= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, as well as elements 5-7 and places them in a vector y in reverse order, for example:\u003c/p\u003e\u003cp\u003ex = [1 2 3 4 5 6 7] --\u0026gt; y = [5 6 7 2]\u003c/p\u003e","function_template":"function y = extract_elements(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5 6 7];\r\ny = [5 6 7 2];\r\nassert(isequal(extract_elements(x),y))\r\n\r\n%%\r\nx = [3 7 12 9 4 2 8 3 2 1];\r\ny = [4 2 8 7];\r\nassert(isequal(extract_elements(x),y))\r\n\r\n%%\r\nx = [12.2 16.5 13.2 2.5 9.7 7.6 3.1 1.4];\r\ny = [9.7 7.6 3.1 16.5];\r\nassert(isequal(extract_elements(x),y))\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":269,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T16:55:02.000Z","updated_at":"2026-02-12T18:12:16.000Z","published_at":"2015-01-22T19:29:52.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\u003eConsider x a vector of length \u0026gt;= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, as well as elements 5-7 and places them in a vector y in reverse order, for example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex = [1 2 3 4 5 6 7] --\u0026gt; y = [5 6 7 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":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":44835,"title":"Calculate the square of a number (Super Easy)","description":"The goal is to calculate the square (y) of a number (x).\r\nGood way to start MatLab for beginners.","description_html":"\u003cp\u003eThe goal is to calculate the square (y) of a number (x).\r\nGood way to start MatLab for beginners.\u003c/p\u003e","function_template":"function y = square(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2;\r\ny_correct = 4;\r\nassert(isequal(square(x),y_correct))\r\n%%\r\nx = 7;\r\ny_correct = 49;\r\nassert(isequal(square(x),y_correct))\r\n%%\r\nx = 15;\r\ny_correct = 225;\r\nassert(isequal(square(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":280631,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":197,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-01-18T10:19:59.000Z","updated_at":"2026-02-12T19:03:11.000Z","published_at":"2019-01-18T10:19:59.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 goal is to calculate the square (y) of a number (x). Good way to start MatLab for beginners.\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":2864,"title":"Matlab Basics - Absolute Value","description":"Write a script that returns the absolute value of the elements in x\r\n\r\ne.g. x = [-1 -2 -3 -4] --\u003e y = [1 2 3 4]","description_html":"\u003cp\u003eWrite a script that returns the absolute value of the elements in x\u003c/p\u003e\u003cp\u003ee.g. x = [-1 -2 -3 -4] --\u0026gt; y = [1 2 3 4]\u003c/p\u003e","function_template":"function y = absolute_elements(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [-1 -2 -3 -4];\r\ny_correct = [1 2 3 4];\r\nassert(isequal(absolute_elements(x),y_correct))\r\n%%\r\nx = [-1 2 -3 3 4 -2 5 2];\r\ny_correct = [1 2 3 3 4 2 5 2];\r\nassert(isequal(absolute_elements(x),y_correct))\r\n%%\r\nx = [-1.2 -2.6 -3.5 -4.8];\r\ny_correct = [1.2 2.6 3.5 4.8];\r\nassert(isequal(absolute_elements(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":671,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:09:20.000Z","updated_at":"2026-03-29T19:51:21.000Z","published_at":"2015-01-22T19:28: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\",\"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 script that returns the absolute value of the elements in 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ee.g. x = [-1 -2 -3 -4] --\u0026gt; y = [1 2 3 4]\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":2912,"title":"Matlab Basics II - Free Fall","description":"An object freely falling from rest under gravity covers a distance x given by:\r\n\r\nx = 1/2 gt^2\r\n\r\nwrite a function that calculates the distance covered by the object, given time t, use g = 9.81 ms-2","description_html":"\u003cp\u003eAn object freely falling from rest under gravity covers a distance x given by:\u003c/p\u003e\u003cp\u003ex = 1/2 gt^2\u003c/p\u003e\u003cp\u003ewrite a function that calculates the distance covered by the object, given time t, use g = 9.81 ms-2\u003c/p\u003e","function_template":"function x = freefall(t)\r\n  \r\nend","test_suite":"%%\r\nt = 1;\r\nx_correct = 4.905000000000000;\r\nassert(isequal(freefall(t),x_correct))\r\n\r\n%%\r\nt = 3.2;\r\nx_correct = 50.227200000000010;\r\nassert(isequal(freefall(t),x_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":363,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T20:44:20.000Z","updated_at":"2026-02-11T19:37:44.000Z","published_at":"2015-02-02T05:24: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\u003eAn object freely falling from rest under gravity covers a distance x given by:\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 = 1/2 gt^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewrite a function that calculates the distance covered by the object, given time t, use g = 9.81 ms-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":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\"}]}"},{"id":44330,"title":"Matrix element wise multiplication","description":"Take two incoming vectors, and multiply them element wise","description_html":"\u003cp\u003eTake two incoming vectors, and multiply them element wise\u003c/p\u003e","function_template":"function y = your_fcn_name(x,x1)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx = [1 2; 3 4]; x1 = [4 3; 2 1];\r\ny_correct = [     4     6;     6     4];\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":115,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-14T17:37:43.000Z","updated_at":"2026-02-11T18:40:44.000Z","published_at":"2017-09-14T17:37:43.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 two incoming vectors, and multiply them element wise\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":1924,"title":"Create a two dimensional zero matrix","description":"You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.\r\n\r\nExample:\r\n\r\nIf input is m=2 and n=3 then\r\n  \r\n A = [ 0 0 0\r\n       0 0 0 ]\r\n","description_html":"\u003cp\u003eYou have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cp\u003eIf input is m=2 and n=3 then\u003c/p\u003e\u003cpre\u003e A = [ 0 0 0\r\n       0 0 0 ]\u003c/pre\u003e","function_template":"function y = zero_matrix(m,n)\r\n\r\nend","test_suite":"%%\r\nm = 2;n=3;\r\ny_correct = [0 0 0;0 0 0]\r\nassert(isequal(zero_matrix(m,n),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":18256,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":525,"test_suite_updated_at":"2013-10-08T18:58:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-10-08T18:25:50.000Z","updated_at":"2026-02-08T06:16:27.000Z","published_at":"2013-10-08T18:25: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.\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\u003eIf input is m=2 and n=3 then\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 = [ 0 0 0\\n       0 0 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":2857,"title":"Matlab Basics - Convert a row vector to a column vector","description":"Write a script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any row vector of any length","description_html":"\u003cp\u003eWrite a script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any row vector of any length\u003c/p\u003e","function_template":"function y = row_to_col(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny = 1;\r\nassert(isequal(row_to_col(x),y))\r\n%%\r\nx = [1 2 3];\r\ny = [1;2;3];\r\nassert(isequal(row_to_col(x),y))\r\n%%\r\nx = [4 5 6 7 8 9];\r\ny = [4;5;6;7;8;9];\r\nassert(isequal(row_to_col(x),y))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":679,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-20T19:25:10.000Z","updated_at":"2026-03-22T21:15:22.000Z","published_at":"2015-01-22T19:34:34.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 script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any row vector of any length\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":1797,"title":"03 - Matrix Variables 1","description":"Make the following variable:\r\n\r\n\u003c\u003chttp://samle.dk/STTBDP/Assignment1_3a.png\u003e\u003e\r\n\r\nA 9x9 matrix full of 2's\r\n\r\n(Hint: use *ones* or *zeros*)\r\n","description_html":"\u003cp\u003eMake the following variable:\u003c/p\u003e\u003cimg src = \"http://samle.dk/STTBDP/Assignment1_3a.png\"\u003e\u003cp\u003eA 9x9 matrix full of 2's\u003c/p\u003e\u003cp\u003e(Hint: use \u003cb\u003eones\u003c/b\u003e or \u003cb\u003ezeros\u003c/b\u003e)\u003c/p\u003e","function_template":"function aMat = MatrixFunc()\r\n  *Insert code here\r\nend","test_suite":"%%\r\nref = ones(9,9)*2;\r\nuser = MatrixFunc();\r\nassert(isequal(user,ref))","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":15468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":715,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-13T13:48:16.000Z","updated_at":"2026-02-24T03:00:51.000Z","published_at":"2013-08-13T13:48:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"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\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA 9x9 matrix full of 2's\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\u003e(Hint: 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eones\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ezeros\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\"},{\"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,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\"}]}"},{"id":1792,"title":"02 - Vector Variables 2","description":"Make the following variable:\r\n\r\n\u003c\u003chttp://samle.dk/STTBDP/Assignment1_2b.png\u003e\u003e","description_html":"\u003cp\u003eMake the following variable:\u003c/p\u003e\u003cimg src = \"http://samle.dk/STTBDP/Assignment1_2b.png\"\u003e","function_template":"function bVec = VectorFunc()\r\n  *Insert code here\r\nend","test_suite":"%%\r\nbVec = [2.71;8;28;182];\r\nb = VectorFunc();\r\nassert(isequal(b,bVec))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":15468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":719,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-13T13:30:23.000Z","updated_at":"2026-02-24T03:00:14.000Z","published_at":"2013-08-13T13:30:23.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,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\"}]}"},{"id":45522,"title":"Electric Flux","description":"Calculate the flux passing through a surface.\r\nE is electric field, A is area.","description_html":"\u003cp\u003eCalculate the flux passing through a surface.\r\nE is electric field, A is area.\u003c/p\u003e","function_template":"function Flux = electric_fcn_flux(E,A)\r\n  Flux = ;\r\nend","test_suite":"%%\r\nE = 0;\r\nA = 10;\r\nFlux_correct = 0;\r\nassert(isequal(electric_fcn_flux(E,A),Flux_correct))\r\n\r\n%%\r\nE = 2;\r\nA = 10;\r\nFlux_correct = 20;\r\nassert(isequal(electric_fcn_flux(E,A),Flux_correct))\r\n\r\n%%\r\nE = 5;\r\nA = 10;\r\nFlux_correct = 50;\r\nassert(isequal(electric_fcn_flux(E,A),Flux_correct))\r\n\r\n%%\r\nE = 10;\r\nA = 10;\r\nFlux_correct = 100;\r\nassert(isequal(electric_fcn_flux(E,A),Flux_correct))\r\n\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":444624,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":78,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-05-17T13:38:58.000Z","updated_at":"2026-02-10T08:26:09.000Z","published_at":"2020-05-17T13:38:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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 flux passing through a surface. E is electric field, A is area.\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":43627,"title":"Find Euclidean norm of given vector u.","description":"Find Euclidean norm of given vector u.\r\nhttps://en.wikipedia.org/wiki/Euclidean_distance\r\nExample \r\nx=[1 1]\r\nresult=sqrt(1^2+1^2)=1.4142","description_html":"\u003cp\u003eFind Euclidean norm of given vector u.\r\nhttps://en.wikipedia.org/wiki/Euclidean_distance\r\nExample \r\nx=[1 1]\r\nresult=sqrt(1^2+1^2)=1.4142\u003c/p\u003e","function_template":"function y = VecNorm(u)\r\n  y = u;\r\nend","test_suite":"%%\r\nu = 1;\r\ny_correct = 1;\r\nassert(isequal(VecNorm(u),y_correct))\r\n%%\r\nu = [1 1];\r\ny_correct = 1.4142 ;\r\nassert(abs(VecNorm(u)-y_correct)\u003c10^(-4))\r\n%%\r\nu = [5     2     0     5     3     0];\r\ny_correct =  7.9373;\r\nassert(abs(VecNorm(u)-y_correct)\u003c10^(-4))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":74,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-25T19:13:22.000Z","updated_at":"2026-02-10T18:14:53.000Z","published_at":"2016-10-25T19:13: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\u003eFind Euclidean norm of given vector u. https://en.wikipedia.org/wiki/Euclidean_distance Example x=[1 1] result=sqrt(1^2+1^2)=1.4142\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":44328,"title":"Sum two matrices","description":"Take two incoming matrices, and sum them","description_html":"\u003cp\u003eTake two incoming matrices, and sum them\u003c/p\u003e","function_template":"function y = your_fcn_name(x, x1)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx = [1 2; 3 4]; x1 = [4 3; 2 1];\r\ny_correct = 5*ones(2);\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = ones(3,5); x1 = x;\r\ny_correct = 2*x;\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = 1:10; x1 = 10:-1:1;\r\ny_correct = 11*ones(1,10);\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = magic(3); x1 = flipud(fliplr(x));\r\ny_correct = 10*ones(3);\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = [1 5 7 9]; x1 = [3 -5 6 15];\r\ny_correct = [4 0 13 24];\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = eye(4); x1 = fliplr(x);\r\ny_correct = [1,0,0,1;0,1,1,0;0,1,1,0;1,0,0,1];\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":177,"test_suite_updated_at":"2017-09-15T16:05:42.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-14T17:33:35.000Z","updated_at":"2026-02-11T18:29:09.000Z","published_at":"2017-09-14T17:33: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\u003eTake two incoming matrices, and sum them\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":42526,"title":"Initialize a Natural Number matrix.","description":"Given length of matrix initialize a matrix consisting of natural numbers from 1 to n:\r\n\r\nn = 10;\r\nx = [ 1 2 3 4 5 6 7 8 9 10];\r\n\r\nn = 5;\r\nx = [1 2 3 4 5];","description_html":"\u003cp\u003eGiven length of matrix initialize a matrix consisting of natural numbers from 1 to n:\u003c/p\u003e\u003cp\u003en = 10;\r\nx = [ 1 2 3 4 5 6 7 8 9 10];\u003c/p\u003e\u003cp\u003en = 5;\r\nx = [1 2 3 4 5];\u003c/p\u003e","function_template":"function y = naturalNumbers(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(naturalNumbers(x),y_correct))\r\n\r\n%%\r\nx = 3;\r\ny_correct = [1 2 3];\r\nassert(isequal(naturalNumbers(x),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":48756,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":124,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-22T17:20:10.000Z","updated_at":"2026-04-02T18:59:44.000Z","published_at":"2015-08-22T17:24:03.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 length of matrix initialize a matrix consisting of natural numbers from 1 to 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003en = 10; x = [ 1 2 3 4 5 6 7 8 9 10];\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\u003en = 5; x = [1 2 3 4 5];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":43621,"title":"Get derivarive of polynomial given as vector array.","description":"Get derivarive of polynomial given as vector array.\r\n\r\nExample  \r\n\r\np=[ 1     2     0     5     0     3 ];\r\n\r\nresult=[ 5 8 0 10 0 ];","description_html":"\u003cp\u003eGet derivarive of polynomial given as vector array.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cp\u003ep=[ 1     2     0     5     0     3 ];\u003c/p\u003e\u003cp\u003eresult=[ 5 8 0 10 0 ];\u003c/p\u003e","function_template":"function y = PolyPol(x)\r\n  y = x;\r\nend","test_suite":"%%\r\np = [ 1     2     0     5     0     3 ];\r\ny_correct = [ 5 8 0 10 0 ];\r\nassert(isequal(PolyPol(p),y_correct))\r\n%%\r\np = [ 3     2     5     1     0     2];\r\ny_correct = [ 15     8    15     2     0 ];\r\nassert(isequal(PolyPol(p),y_correct))\r\n%%\r\np = [ 15     8    15     2     0 ];\r\ny_correct = [  60    24    30     2 ];\r\nassert(isequal(PolyPol(p),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":83,"test_suite_updated_at":"2016-10-25T09:14:14.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-25T09:10:39.000Z","updated_at":"2026-03-22T02:28:51.000Z","published_at":"2016-10-25T09:14:14.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eGet derivarive of polynomial given as vector 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\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\u003ep=[ 1 2 0 5 0 3 ];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eresult=[ 5 8 0 10 0 ];\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":172,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-14T12:23:02.000Z","updated_at":"2026-03-31T13:29:11.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":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":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":42500,"title":"replace empty matrices with '[]' ","description":"for example\r\n\r\n  a=1;a(:,1)=[]; returns \r\n  a =\r\n     Empty matrix: 1-by-0\r\n  use this as the input,and the output should be '[]'\r\n\r\n\r\n*require no appearance of '[]' and 'empty' method inside the function*","description_html":"\u003cp\u003efor example\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ea=1;a(:,1)=[]; returns \r\na =\r\n   Empty matrix: 1-by-0\r\nuse this as the input,and the output should be '[]'\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003erequire no appearance of '[]' and 'empty' method inside the function\u003c/b\u003e\u003c/p\u003e","function_template":"function y = funny(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = int8.empty(3,0);\r\ny_correct = [];\r\nassert(isequal(funny(x),y_correct))\r\n\r\n%%\r\ntext=fileread('funny.m');\r\nassert(isempty(strfind(text,'[]')))\r\nassert(isempty(strfind(text,'empty')))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":40597,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":56,"test_suite_updated_at":"2015-08-09T06:13:58.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-09T06:07:51.000Z","updated_at":"2026-02-09T13:42:48.000Z","published_at":"2015-08-09T06:07:51.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\u003efor example\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=1;a(:,1)=[]; returns \\na =\\n   Empty matrix: 1-by-0\\nuse this as the input,and the output should be '[]']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003erequire no appearance of '[]' and 'empty' method inside the function\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":1791,"title":"02 - Vector Variables 1","description":"Make the following variable:\r\n\r\n\u003c\u003chttp://samle.dk/STTBDP/Assignment1_2a.png\u003e\u003e","description_html":"\u003cp\u003eMake the following variable:\u003c/p\u003e\u003cimg src = \"http://samle.dk/STTBDP/Assignment1_2a.png\"\u003e","function_template":"function aVec = VectorFunc()\r\n  *Insert code here\r\nend","test_suite":"%%\r\naVec = [3.14 15 9 26];\r\na = VectorFunc();\r\nassert(isequal(a,aVec))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":15468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":721,"test_suite_updated_at":"2013-08-27T09:52:03.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-13T13:23:08.000Z","updated_at":"2026-03-05T09:24:53.000Z","published_at":"2013-08-13T13:23: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\",\"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,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\"}]}"},{"id":44493,"title":"The great 82-year-old","description":"Let's answer the question below;\r\n\r\n'I am *x* years old and I have never written programs.\r\nIf I study from now, will I be able to develop programs?'\r\n\r\ninput *x* (years old) \u003e\u003e\u003e output 'Yes' or 'No'","description_html":"\u003cp\u003eLet's answer the question below;\u003c/p\u003e\u003cp\u003e'I am \u003cb\u003ex\u003c/b\u003e years old and I have never written programs.\r\nIf I study from now, will I be able to develop programs?'\u003c/p\u003e\u003cp\u003einput \u003cb\u003ex\u003c/b\u003e (years old) \u0026gt;\u0026gt;\u0026gt; output 'Yes' or 'No'\u003c/p\u003e","function_template":"function Answer = Age(x)\r\n  Answer = 'Yes';\r\nend","test_suite":"%%\r\nx = 20;\r\ny_correct = 'Yes';\r\nassert(isequal(Age(x),y_correct))\r\n%%\r\nx = 40;\r\ny_correct = 'Yes';\r\nassert(isequal(Age(x),y_correct))\r\n%% Great Ms Masako Wakamiya\r\nx = 82-1;\r\ny_correct = 'Yes';\r\nassert(isequal(Age(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":137687,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":152,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-01-08T12:47:36.000Z","updated_at":"2026-02-15T11:10:56.000Z","published_at":"2018-01-08T12:58:55.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\u003eLet's answer the question below;\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\u003e'I am\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e years old and I have never written programs. If I study from now, will I be able to develop programs?'\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\u003einput\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ex\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (years old) \u0026gt;\u0026gt;\u0026gt; output 'Yes' or 'No'\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":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":43691,"title":"determine if ","description":"determine if the elements of a matrix is a nan and return true","description_html":"\u003cp\u003edetermine if the elements of a matrix is a nan and return true\u003c/p\u003e","function_template":"function y = my_function(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [1 0 5 nan];\r\ny_correct = [0 0 0 1]\r\nassert(isequal(my_function(x),y_correct))\r\n%%\r\nx = [nan 1; 5 nan];\r\ny_correct = [1 0;0 1]\r\nassert(isequal(my_function(x),y_correct))\r\n%%\r\nx = [nan nan nan;nan nan nan];\r\ny_correct = [1 1 1;1 1 1]\r\nassert(isequal(my_function(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":88437,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":102,"test_suite_updated_at":"2016-11-28T02:45:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-11-28T02:42:32.000Z","updated_at":"2026-02-11T18:28:36.000Z","published_at":"2016-11-28T02:42: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\",\"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 if the elements of a matrix is a nan and return true\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":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":44326,"title":"Replace 0 indices in array with 1's","description":"Take a incoming vector, and replace 0's with ones","description_html":"\u003cp\u003eTake a incoming vector, and replace 0's with ones\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx = -1:1:3\r\ny_correct = [-1 1 1 2 3];\r\nassert(isequal(your_fcn_name(x),y_correct))\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":143,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-14T17:22:35.000Z","updated_at":"2026-02-09T17:09:04.000Z","published_at":"2017-09-14T17:22: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\u003eTake a incoming vector, and replace 0's with ones\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":43887,"title":"Radians to Degrees","description":"Convert radians to degrees.","description_html":"\u003cp\u003eConvert radians to degrees.\u003c/p\u003e","function_template":"function D = RAD2DEG(R)\r\n;\r\nend","test_suite":"%%\r\nR = pi/2;\r\nD_correct =90;\r\nassert(isequal(RAD2DEG(R),D_correct))\r\n\r\n%%\r\nR = pi;\r\nD_correct = 180;\r\nassert(isequal(RAD2DEG(R),D_correct))\r\n\r\n%%\r\nR = 2*pi;\r\nD_correct = 360;\r\nassert(isequal(RAD2DEG(R),D_correct))\r\n\r\n%%\r\nR = 3*pi;\r\nD_correct = 540;\r\nassert(isequal(RAD2DEG(R),D_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":100606,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":201,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-20T17:14:04.000Z","updated_at":"2026-02-08T05:40:37.000Z","published_at":"2016-12-20T17:14:04.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConvert radians to degrees.\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":47113,"title":"Distance Travelled by Vehicle","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: 101.2px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 50.6px; transform-origin: 407px 50.6px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 41.6px; 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 20.8px; text-align: left; transform-origin: 384px 20.8px; 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=\"\"\u003eGiven a vehicle travelling at a velocity of 10m/s and having a constant acceleration of 5m/s^2, write a function that gives the distance travelled by the vehicle in time t.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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=\"\"\u003eUnits of distance is m and time sec.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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=\"\"\u003eHint:  Remember Newton\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function dist = d_in_t(t)\r\n  dist = t;\r\nend","test_suite":"%%\r\nt = 1;\r\ny_correct = 12.5;\r\nassert(isequal(d_in_t(t),y_correct))\r\n%%\r\nt = 5;\r\ny_correct = 112.5;\r\nassert(isequal(d_in_t(t),y_correct))\r\n%%\r\nt = 10;\r\ny_correct = 350;\r\nassert(isequal(d_in_t(t),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":511890,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-28T08:21:47.000Z","updated_at":"2026-02-05T15:52:02.000Z","published_at":"2020-10-28T08:21:47.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\u003eGiven a vehicle travelling at a velocity of 10m/s and having a constant acceleration of 5m/s^2, write a function that gives the distance travelled by the vehicle in time t.\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\u003eUnits of distance is m and time sec.\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\u003eHint:  Remember Newton\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":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":44300,"title":"Matrix Generation from Vector Multiplication","description":"Output the matrix generated from multiplying two vectors together","description_html":"\u003cp\u003eOutput the matrix generated from multiplying two vectors together\u003c/p\u003e","function_template":"function out_matrix = your_fcn_name(x,y)\r\n  out_matrix = ...;\r\nend","test_suite":"%%\r\nx = [1; 2];\r\ny = [1 2];\r\nout_matrix = [1 2; 2 4];\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = (1:3)';\r\ny = 1:3;\r\nout_matrix = [1,2,3;2,4,6;3,6,9];\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = ones(10,1);\r\ny = ones(1,10);\r\nout_matrix = ones(10);\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = ones(1,10);\r\ny = ones(10,1);\r\nout_matrix = 10;\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = ones(3,1);\r\ny = [7 6 8];\r\nout_matrix = repmat(y,[3,1]);\r\nassert(isequal(your_fcn_name(x,y),out_matrix))\r\n\r\n%%\r\nx = [1;0;1;0;1];\r\ny = [0,1,0,1,0];\r\nout_matrix = [0,1,0,1,0;0,0,0,0,0;0,1,0,1,0;0,0,0,0,0;0,1,0,1,0];\r\nassert(isequal(your_fcn_name(x,y),out_matrix))","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":95,"test_suite_updated_at":"2017-09-08T19:39:11.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T01:11:33.000Z","updated_at":"2026-02-11T18:40:07.000Z","published_at":"2017-09-06T01:11:33.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\u003eOutput the matrix generated from multiplying two vectors together\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":44092,"title":"Find the minimal value in N*N Matrix","description":"Suppose that we have N by N matrix, we try to find the minimal value in that matrix.\r\nexamples:\r\nInput  A=[1 2 3 5 6;52 58 56 45 9;100 52 896 25 47; 52 325 6 2 1;1 1 1 1 2]\r\nOutput B=1\r\n\r\nInput  A=[1 0 3]\r\nOutput B=0  ","description_html":"\u003cp\u003eSuppose that we have N by N matrix, we try to find the minimal value in that matrix.\r\nexamples:\r\nInput  A=[1 2 3 5 6;52 58 56 45 9;100 52 896 25 47; 52 325 6 2 1;1 1 1 1 2]\r\nOutput B=1\u003c/p\u003e\u003cp\u003eInput  A=[1 0 3]\r\nOutput B=0\u003c/p\u003e","function_template":"function B = Min_Val(A)\r\n  B = A;\r\nend","test_suite":"%%\r\nA =[100 200 2 5 0.1];\r\nB_correct = 0.1;\r\nassert(isequal(Min_Val(A),B_correct))\r\n%%\r\nA =[10 3 2; 5 0 1;7 8 2];\r\nB_correct = 0;\r\nassert(isequal(Min_Val(A),B_correct))\r\n%%\r\nA =1;\r\nB_correct =A;\r\nassert(isequal(Min_Val(A),B_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":37163,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":116,"test_suite_updated_at":"2017-04-12T11:39:10.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-04-12T11:30:20.000Z","updated_at":"2026-02-11T18:39:27.000Z","published_at":"2017-04-12T11:39:10.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\u003eSuppose that we have N by N matrix, we try to find the minimal value in that matrix. examples: Input A=[1 2 3 5 6;52 58 56 45 9;100 52 896 25 47; 52 325 6 2 1;1 1 1 1 2] Output B=1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput A=[1 0 3] Output B=0\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":44235,"title":"Shift elements of vector left","description":"Shift elements of vector to the left.\r\nFor ex. : Input_vec = [1 2 3 4 5]\r\nOutput_vec = [2 3 4 5 1]\r\n","description_html":"\u003cp\u003eShift elements of vector to the left.\r\nFor ex. : Input_vec = [1 2 3 4 5]\r\nOutput_vec = [2 3 4 5 1]\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5];\r\ny_correct = [2 3 4 5 1];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [10 56 98 -10];\r\ny_correct = [56 98 -10 10];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 'Matlab';\r\ny_correct = 'atlabM';\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","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":137674,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":111,"test_suite_updated_at":"2017-06-14T10:15:22.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2017-06-14T09:55:53.000Z","updated_at":"2026-02-11T18:39:52.000Z","published_at":"2017-06-14T09:56:18.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eShift elements of vector to the left. For ex. : Input_vec = [1 2 3 4 5] Output_vec = [2 3 4 5 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":2880,"title":"Matlab Basics II - Determine if an array has a 3rd dimension","description":"For an array A, determine whether it has 3 dimensions, return 0 if x is only 2D, and 1 if x is 3D","description_html":"\u003cp\u003eFor an array A, determine whether it has 3 dimensions, return 0 if x is only 2D, and 1 if x is 3D\u003c/p\u003e","function_template":"function y = three_d(x)\r\n  \r\nend","test_suite":"%%\r\nx(:,:,1) = [1 2 3];\r\nx(:,:,2) = [4 5 6];\r\nx(:,:,3) = [7 8 9];\r\ny_correct = 1;\r\nassert(isequal(three_d(x),y_correct))\r\n%%\r\nx(:,1) = [4 7 38];\r\nx(:,2) = [42 45 6];\r\ny_correct = 0;\r\nassert(isequal(three_d(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":167,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-27T19:39:36.000Z","updated_at":"2026-02-11T18:33:22.000Z","published_at":"2015-02-02T05:23: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\",\"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\u003eFor an array A, determine whether it has 3 dimensions, return 0 if x is only 2D, and 1 if x is 3D\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":54860,"title":"Create a column vector of n elements between a and b (both included)","description":"Given lower limit a and an upper limit b, create a column vector of n elements inclusive of a and b.\r\nFor example: a = 1, b = 4, n = 4  \r\n                      y = [1;2;3;4];","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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.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=\"\"\u003eGiven lower limit a and an upper limit b, create a \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-weight: 700; \"\u003ecolumn\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 vector of n elements inclusive of a and b.\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=\"\"\u003eFor example: a = 1, b = 4, n = 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=\"\"\u003e                      y = [1;2;3;4];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(a, b, n)\r\n    \r\nend","test_suite":"%%\r\na = 1;\r\nb = 1;\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(a, b, n),y_correct))\r\n\r\n%%\r\na = 1;\r\nb = 10;\r\nn = 3;\r\ny_correct = [1; 5.5; 10];\r\nassert(isequal(your_fcn_name(a, b, n),y_correct))\r\n\r\n%%\r\na = 2;\r\nb = 10;\r\nn = 5;\r\ny_correct = [2;4;6;8;10];\r\nassert(isequal(your_fcn_name(a, b, n),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":2436220,"edited_by":2436220,"edited_at":"2022-07-12T14:26:21.000Z","deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":"2022-07-12T14:26:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-07-12T14:20:07.000Z","updated_at":"2026-03-09T18:48:18.000Z","published_at":"2022-07-12T14:26:21.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven lower limit a and an upper limit b, create a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ecolumn\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e vector of n elements inclusive of a and b.\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\u003eFor example: a = 1, b = 4, n = 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\u003e                      y = [1;2;3;4];\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":44294,"title":"Simple String Concatenation","description":"This is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.","description_html":"\u003cp\u003eThis is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.\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 = 'apple pear';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'one';\r\nstr2 = 'two';\r\nconcat_str = 'one 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 = 'one two 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 = 'hello 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 = 'This is half a sentence; 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 = 'left right';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n\r\n%%\r\nstr1 = 'right';\r\nstr2 = 'left';\r\nconcat_str = 'right 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 = ' leading space 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 = '123 456';\r\nassert(isequal(your_fcn_name(str1, str2),concat_str))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":86,"test_suite_updated_at":"2017-09-08T19:18:15.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-06T00:32:01.000Z","updated_at":"2026-03-02T17:19:15.000Z","published_at":"2017-09-06T00:32:01.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\u003eThis is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating the strings.\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":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":43689,"title":"Make an identity matrix whose diagonal elements are 1:n","description":"For a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5:\r\n\r\n output = [1 0 0 0 0;\r\n           0 2 0 0 0;\r\n           0 0 3 0 0;\r\n           0 0 0 4 0;\r\n           0 0 0 0 5]\r\n","description_html":"\u003cp\u003eFor a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5:\u003c/p\u003e\u003cpre\u003e output = [1 0 0 0 0;\r\n           0 2 0 0 0;\r\n           0 0 3 0 0;\r\n           0 0 0 4 0;\r\n           0 0 0 0 5]\u003c/pre\u003e","function_template":"function y = special_eye(n)\r\n  y = n\r\nend","test_suite":"%%\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 2;\r\ny_correct = [1 0;0 2]\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 3;\r\ny_correct = [1 0 0;0 2 0;0 0 3]\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 4;\r\ny_correct = [1 0 0 0;0 2 0 0;0 0 3 0;0 0 0 4]\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 5;\r\ny_correct = [1 0 0 0 0;0 2 0 0 0;0 0 3 0 0; 0 0 0 4 0; 0 0 0 0 5]\r\nassert(isequal(special_eye(n),y_correct))\r\n%%\r\nn = 6;\r\ny_correct = [1 0 0 0 0 0;0 2 0 0 0 0;0 0 3 0 0 0; 0 0 0 4 0 0; 0 0 0 0 5 0; 0 0 0 0 0 6]\r\nassert(isequal(special_eye(n),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":88437,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":123,"test_suite_updated_at":"2016-12-21T21:19:59.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-11-28T02:38:35.000Z","updated_at":"2026-02-10T22:03:12.000Z","published_at":"2016-11-28T02:38: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\",\"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\u003eFor a given input n, make an n by n identity matrix that contains the elements 1:n along its diagonal. For example, if input=5:\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[ output = [1 0 0 0 0;\\n           0 2 0 0 0;\\n           0 0 3 0 0;\\n           0 0 0 4 0;\\n           0 0 0 0 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":43617,"title":"Calculate the values of a polynomial.","description":"Calculate the values of a polynomial.Input parameter p - vector of polynomial coefficients, x - matrix of the argument values.\r\n\r\nExample \r\n\r\np=[-1 1]\r\n\r\nx=[1 2;3 4]\r\n\r\nresult=[ 0 -1; -2 -3]","description_html":"\u003cp\u003eCalculate the values of a polynomial.Input parameter p - vector of polynomial coefficients, x - matrix of the argument values.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cp\u003ep=[-1 1]\u003c/p\u003e\u003cp\u003ex=[1 2;3 4]\u003c/p\u003e\u003cp\u003eresult=[ 0 -1; -2 -3]\u003c/p\u003e","function_template":"function y = SolvePoly(p,x)\r\n  y = x;\r\nend","test_suite":"%%\r\np=[-1 1]\r\nx=[1 2;3 4]\r\ny_correct=[ 0 -1; -2 -3]\r\nassert(isequal(SolvePoly(p,x),y_correct))\r\n%%\r\np=[-2     0     1    -1     3     2]\r\nx=[5 6 11; 2 13 7; 4 9 21]\r\ny_correct=[-6133      -15352     -320857;\r\n           -52        -740517    -33297;\r\n           -1986      -117421    -8159317]\r\nassert(isequal(SolvePoly(p,x),y_correct))       ","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":90467,"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":"2016-10-24T22:55:06.000Z","updated_at":"2026-02-25T20:49:54.000Z","published_at":"2016-10-24T22:55: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\u003eCalculate the values of a polynomial.Input parameter p - vector of polynomial coefficients, x - matrix of the argument values.\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\u003ep=[-1 1]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex=[1 2;3 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\u003eresult=[ 0 -1; -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":1449,"title":"Saving MATLAB session to a file","description":"How to save MATLAB session to a file?","description_html":"\u003cp\u003eHow to save MATLAB session to a file?\u003c/p\u003e","function_template":"function y = your_fcn_name\r\n  y = 'guess';\r\nend","test_suite":"%%\r\ny_correct = 'diary';\r\nassert(isequal(your_fcn_name,y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":10792,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":201,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-04-23T10:23:52.000Z","updated_at":"2026-02-05T16:25:33.000Z","published_at":"2013-04-23T10:23:52.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\u003eHow to save MATLAB session to a file?\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":43737,"title":"Alternative Dimensions","description":"Given a multidimensional matrix, transform the matrix so the dimensions are in the order given by variable ord. For example, given the following matrix:\r\n\r\nm has 3 dimensions\r\n\r\n  m(1,:,:) = all 1s\r\n  m(2,:,:) = all 2s\r\n  m(3,:,:) = all 3s\r\n\r\nAfter the transformation to [3 2 1], the matrix should be:\r\n\r\n  m(:,:,1) = all 1s\r\n  m(:,:,2) = all 2s\r\n  m(:,:,3) = all 3s","description_html":"\u003cp\u003eGiven a multidimensional matrix, transform the matrix so the dimensions are in the order given by variable ord. For example, given the following matrix:\u003c/p\u003e\u003cp\u003em has 3 dimensions\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003em(1,:,:) = all 1s\r\nm(2,:,:) = all 2s\r\nm(3,:,:) = all 3s\r\n\u003c/pre\u003e\u003cp\u003eAfter the transformation to [3 2 1], the matrix should be:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003em(:,:,1) = all 1s\r\nm(:,:,2) = all 2s\r\nm(:,:,3) = all 3s\r\n\u003c/pre\u003e","function_template":"function y = transform(M,ord)\r\n  y = x;\r\nend","test_suite":"%%\r\nM=ones(3,3,3);\r\nM(2,:,:)=2.*M(2,:,:);\r\nM(3,:,:)=3.*M(3,:,:);\r\nord = [3,2,1];\r\nMC = ones(3,3,3);\r\nMC(:,:,2)=2.*MC(:,:,2);\r\nMC(:,:,3)=3.*MC(:,:,3);\r\nassert(isequal(transform(M,ord),MC))\r\n%%\r\nM=rand(1,2,3,4,5,6);\r\nord = [6 1 5 2 4 3];\r\nassert(isequal(size(transform(M,ord)),ord))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":93456,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-12-06T23:42:04.000Z","updated_at":"2026-02-19T15:41:13.000Z","published_at":"2016-12-06T23:42:04.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a multidimensional matrix, transform the matrix so the dimensions are in the order given by variable ord. For example, given the following matrix:\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\u003em has 3 dimensions\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[m(1,:,:) = all 1s\\nm(2,:,:) = all 2s\\nm(3,:,:) = all 3s]]\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\u003eAfter the transformation to [3 2 1], the matrix should be:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[m(:,:,1) = all 1s\\nm(:,:,2) = all 2s\\nm(:,:,3) = all 3s]]\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":2924,"title":"Matlab Basics II - Operations and Matrix Dimensions","description":"Write a function that takes two inputs, a \u0026 b, and outputs the sum and product of the two matrices. The matrices have OPPOSITE dimensions: if, for example, a is 3x2, then b is 2x3. Round your answers to two decimal places.","description_html":"\u003cp\u003eWrite a function that takes two inputs, a \u0026 b, and outputs the sum and product of the two matrices. The matrices have OPPOSITE dimensions: if, for example, a is 3x2, then b is 2x3. Round your answers to two decimal places.\u003c/p\u003e","function_template":"function out = add_mult(a,b)\r\n  x =\r\n  y = \r\n  out = [{x},{y}];\r\nend","test_suite":"%%\r\na = [1 -2 7];\r\nb = [2;6;-1];\r\nout = [{[3.00 4.00 6.00]},{-17.00}];\r\nassert(isequal(add_mult(a,b),out))\r\n\r\n%%\r\na = [0.2922 0.1557 0.3491; 0.4595 -0.4643 0.4340];\r\nb = [0.4572 -0.3581; -0.0146 -0.0782; 0.3003 0.4157];\r\nout = [{[0.75 0.14 0.65; 0.1 -0.54 0.85]},{[0.24 0.03; 0.35 0.05]}];\r\nassert(isequal(add_mult(a,b),out))","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":101,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-02T03:29:51.000Z","updated_at":"2026-02-12T18:14:36.000Z","published_at":"2015-02-02T05:28:43.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 that takes two inputs, a \u0026amp; b, and outputs the sum and product of the two matrices. The matrices have OPPOSITE dimensions: if, for example, a is 3x2, then b is 2x3. Round your answers to two decimal places.\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":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":46763,"title":"Double 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: 81px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 40.5px; transform-origin: 407px 40.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]\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 0 2 0 3 0 4 0]\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=\"\"\u003eAdd zeros in between the data\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function double= your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [5 4 3 2];\r\ny_correct = [5 0 4 0 3 0 2 0];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx= [1 2 3 4];\r\ny_correct=[1 0 2 0 3 0 4 0];\r\nassert(isequal(your_fcn_name(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":628208,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":50,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-16T15:49:54.000Z","updated_at":"2026-02-12T19:01:30.000Z","published_at":"2020-10-16T15:57:17.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]\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 0 2 0 3 0 4 0]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAdd zeros in between the data\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":2862,"title":"Matlab Basics - Pick out parts of a vector","description":"Consider x a vector of length \u003e= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, as well as elements 5-7 and places them in a vector y in reverse order, for example:\r\n\r\nx = [1 2 3 4 5 6 7] --\u003e y = [5 6 7 2]","description_html":"\u003cp\u003eConsider x a vector of length \u0026gt;= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, as well as elements 5-7 and places them in a vector y in reverse order, for example:\u003c/p\u003e\u003cp\u003ex = [1 2 3 4 5 6 7] --\u0026gt; y = [5 6 7 2]\u003c/p\u003e","function_template":"function y = extract_elements(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5 6 7];\r\ny = [5 6 7 2];\r\nassert(isequal(extract_elements(x),y))\r\n\r\n%%\r\nx = [3 7 12 9 4 2 8 3 2 1];\r\ny = [4 2 8 7];\r\nassert(isequal(extract_elements(x),y))\r\n\r\n%%\r\nx = [12.2 16.5 13.2 2.5 9.7 7.6 3.1 1.4];\r\ny = [9.7 7.6 3.1 16.5];\r\nassert(isequal(extract_elements(x),y))\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":269,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T16:55:02.000Z","updated_at":"2026-02-12T18:12:16.000Z","published_at":"2015-01-22T19:29:52.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\u003eConsider x a vector of length \u0026gt;= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, as well as elements 5-7 and places them in a vector y in reverse order, for example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex = [1 2 3 4 5 6 7] --\u0026gt; y = [5 6 7 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":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":44835,"title":"Calculate the square of a number (Super Easy)","description":"The goal is to calculate the square (y) of a number (x).\r\nGood way to start MatLab for beginners.","description_html":"\u003cp\u003eThe goal is to calculate the square (y) of a number (x).\r\nGood way to start MatLab for beginners.\u003c/p\u003e","function_template":"function y = square(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 2;\r\ny_correct = 4;\r\nassert(isequal(square(x),y_correct))\r\n%%\r\nx = 7;\r\ny_correct = 49;\r\nassert(isequal(square(x),y_correct))\r\n%%\r\nx = 15;\r\ny_correct = 225;\r\nassert(isequal(square(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":280631,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":197,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-01-18T10:19:59.000Z","updated_at":"2026-02-12T19:03:11.000Z","published_at":"2019-01-18T10:19:59.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 goal is to calculate the square (y) of a number (x). Good way to start MatLab for beginners.\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":2864,"title":"Matlab Basics - Absolute Value","description":"Write a script that returns the absolute value of the elements in x\r\n\r\ne.g. x = [-1 -2 -3 -4] --\u003e y = [1 2 3 4]","description_html":"\u003cp\u003eWrite a script that returns the absolute value of the elements in x\u003c/p\u003e\u003cp\u003ee.g. x = [-1 -2 -3 -4] --\u0026gt; y = [1 2 3 4]\u003c/p\u003e","function_template":"function y = absolute_elements(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [-1 -2 -3 -4];\r\ny_correct = [1 2 3 4];\r\nassert(isequal(absolute_elements(x),y_correct))\r\n%%\r\nx = [-1 2 -3 3 4 -2 5 2];\r\ny_correct = [1 2 3 3 4 2 5 2];\r\nassert(isequal(absolute_elements(x),y_correct))\r\n%%\r\nx = [-1.2 -2.6 -3.5 -4.8];\r\ny_correct = [1.2 2.6 3.5 4.8];\r\nassert(isequal(absolute_elements(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":671,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:09:20.000Z","updated_at":"2026-03-29T19:51:21.000Z","published_at":"2015-01-22T19:28: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\",\"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 script that returns the absolute value of the elements in 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ee.g. x = [-1 -2 -3 -4] --\u0026gt; y = [1 2 3 4]\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":2912,"title":"Matlab Basics II - Free Fall","description":"An object freely falling from rest under gravity covers a distance x given by:\r\n\r\nx = 1/2 gt^2\r\n\r\nwrite a function that calculates the distance covered by the object, given time t, use g = 9.81 ms-2","description_html":"\u003cp\u003eAn object freely falling from rest under gravity covers a distance x given by:\u003c/p\u003e\u003cp\u003ex = 1/2 gt^2\u003c/p\u003e\u003cp\u003ewrite a function that calculates the distance covered by the object, given time t, use g = 9.81 ms-2\u003c/p\u003e","function_template":"function x = freefall(t)\r\n  \r\nend","test_suite":"%%\r\nt = 1;\r\nx_correct = 4.905000000000000;\r\nassert(isequal(freefall(t),x_correct))\r\n\r\n%%\r\nt = 3.2;\r\nx_correct = 50.227200000000010;\r\nassert(isequal(freefall(t),x_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":363,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T20:44:20.000Z","updated_at":"2026-02-11T19:37:44.000Z","published_at":"2015-02-02T05:24: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\u003eAn object freely falling from rest under gravity covers a distance x given by:\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 = 1/2 gt^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ewrite a function that calculates the distance covered by the object, given time t, use g = 9.81 ms-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":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\"}]}"},{"id":44330,"title":"Matrix element wise multiplication","description":"Take two incoming vectors, and multiply them element wise","description_html":"\u003cp\u003eTake two incoming vectors, and multiply them element wise\u003c/p\u003e","function_template":"function y = your_fcn_name(x,x1)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx = [1 2; 3 4]; x1 = [4 3; 2 1];\r\ny_correct = [     4     6;     6     4];\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":115,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-14T17:37:43.000Z","updated_at":"2026-02-11T18:40:44.000Z","published_at":"2017-09-14T17:37:43.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 two incoming vectors, and multiply them element wise\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":1924,"title":"Create a two dimensional zero matrix","description":"You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.\r\n\r\nExample:\r\n\r\nIf input is m=2 and n=3 then\r\n  \r\n A = [ 0 0 0\r\n       0 0 0 ]\r\n","description_html":"\u003cp\u003eYou have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cp\u003eIf input is m=2 and n=3 then\u003c/p\u003e\u003cpre\u003e A = [ 0 0 0\r\n       0 0 0 ]\u003c/pre\u003e","function_template":"function y = zero_matrix(m,n)\r\n\r\nend","test_suite":"%%\r\nm = 2;n=3;\r\ny_correct = [0 0 0;0 0 0]\r\nassert(isequal(zero_matrix(m,n),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":18256,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":525,"test_suite_updated_at":"2013-10-08T18:58:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-10-08T18:25:50.000Z","updated_at":"2026-02-08T06:16:27.000Z","published_at":"2013-10-08T18:25: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.\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\u003eIf input is m=2 and n=3 then\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 = [ 0 0 0\\n       0 0 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":2857,"title":"Matlab Basics - Convert a row vector to a column vector","description":"Write a script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any row vector of any length","description_html":"\u003cp\u003eWrite a script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any row vector of any length\u003c/p\u003e","function_template":"function y = row_to_col(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny = 1;\r\nassert(isequal(row_to_col(x),y))\r\n%%\r\nx = [1 2 3];\r\ny = [1;2;3];\r\nassert(isequal(row_to_col(x),y))\r\n%%\r\nx = [4 5 6 7 8 9];\r\ny = [4;5;6;7;8;9];\r\nassert(isequal(row_to_col(x),y))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":679,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-20T19:25:10.000Z","updated_at":"2026-03-22T21:15:22.000Z","published_at":"2015-01-22T19:34:34.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 script to convert a row (e.g. x = [1 2 3]) to a column (e.g. y = [1;2;3]), your script should be able to do this for any row vector of any length\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":1797,"title":"03 - Matrix Variables 1","description":"Make the following variable:\r\n\r\n\u003c\u003chttp://samle.dk/STTBDP/Assignment1_3a.png\u003e\u003e\r\n\r\nA 9x9 matrix full of 2's\r\n\r\n(Hint: use *ones* or *zeros*)\r\n","description_html":"\u003cp\u003eMake the following variable:\u003c/p\u003e\u003cimg src = \"http://samle.dk/STTBDP/Assignment1_3a.png\"\u003e\u003cp\u003eA 9x9 matrix full of 2's\u003c/p\u003e\u003cp\u003e(Hint: use \u003cb\u003eones\u003c/b\u003e or \u003cb\u003ezeros\u003c/b\u003e)\u003c/p\u003e","function_template":"function aMat = MatrixFunc()\r\n  *Insert code here\r\nend","test_suite":"%%\r\nref = ones(9,9)*2;\r\nuser = MatrixFunc();\r\nassert(isequal(user,ref))","published":true,"deleted":false,"likes_count":5,"comments_count":2,"created_by":15468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":715,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-13T13:48:16.000Z","updated_at":"2026-02-24T03:00:51.000Z","published_at":"2013-08-13T13:48:16.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"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\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA 9x9 matrix full of 2's\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\u003e(Hint: 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:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eones\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ezeros\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\"},{\"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,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\"}]}"},{"id":1792,"title":"02 - Vector Variables 2","description":"Make the following variable:\r\n\r\n\u003c\u003chttp://samle.dk/STTBDP/Assignment1_2b.png\u003e\u003e","description_html":"\u003cp\u003eMake the following variable:\u003c/p\u003e\u003cimg src = \"http://samle.dk/STTBDP/Assignment1_2b.png\"\u003e","function_template":"function bVec = VectorFunc()\r\n  *Insert code here\r\nend","test_suite":"%%\r\nbVec = [2.71;8;28;182];\r\nb = VectorFunc();\r\nassert(isequal(b,bVec))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":15468,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":719,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-08-13T13:30:23.000Z","updated_at":"2026-02-24T03:00:14.000Z","published_at":"2013-08-13T13:30:23.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,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\"}]}"},{"id":45522,"title":"Electric Flux","description":"Calculate the flux passing through a surface.\r\nE is electric field, A is area.","description_html":"\u003cp\u003eCalculate the flux passing through a surface.\r\nE is electric field, A is area.\u003c/p\u003e","function_template":"function Flux = electric_fcn_flux(E,A)\r\n  Flux = ;\r\nend","test_suite":"%%\r\nE = 0;\r\nA = 10;\r\nFlux_correct = 0;\r\nassert(isequal(electric_fcn_flux(E,A),Flux_correct))\r\n\r\n%%\r\nE = 2;\r\nA = 10;\r\nFlux_correct = 20;\r\nassert(isequal(electric_fcn_flux(E,A),Flux_correct))\r\n\r\n%%\r\nE = 5;\r\nA = 10;\r\nFlux_correct = 50;\r\nassert(isequal(electric_fcn_flux(E,A),Flux_correct))\r\n\r\n%%\r\nE = 10;\r\nA = 10;\r\nFlux_correct = 100;\r\nassert(isequal(electric_fcn_flux(E,A),Flux_correct))\r\n\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":444624,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":78,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-05-17T13:38:58.000Z","updated_at":"2026-02-10T08:26:09.000Z","published_at":"2020-05-17T13:38:58.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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 flux passing through a surface. E is electric field, A is area.\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":43627,"title":"Find Euclidean norm of given vector u.","description":"Find Euclidean norm of given vector u.\r\nhttps://en.wikipedia.org/wiki/Euclidean_distance\r\nExample \r\nx=[1 1]\r\nresult=sqrt(1^2+1^2)=1.4142","description_html":"\u003cp\u003eFind Euclidean norm of given vector u.\r\nhttps://en.wikipedia.org/wiki/Euclidean_distance\r\nExample \r\nx=[1 1]\r\nresult=sqrt(1^2+1^2)=1.4142\u003c/p\u003e","function_template":"function y = VecNorm(u)\r\n  y = u;\r\nend","test_suite":"%%\r\nu = 1;\r\ny_correct = 1;\r\nassert(isequal(VecNorm(u),y_correct))\r\n%%\r\nu = [1 1];\r\ny_correct = 1.4142 ;\r\nassert(abs(VecNorm(u)-y_correct)\u003c10^(-4))\r\n%%\r\nu = [5     2     0     5     3     0];\r\ny_correct =  7.9373;\r\nassert(abs(VecNorm(u)-y_correct)\u003c10^(-4))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":90467,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":74,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-25T19:13:22.000Z","updated_at":"2026-02-10T18:14:53.000Z","published_at":"2016-10-25T19:13: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\u003eFind Euclidean norm of given vector u. https://en.wikipedia.org/wiki/Euclidean_distance Example x=[1 1] result=sqrt(1^2+1^2)=1.4142\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":44328,"title":"Sum two matrices","description":"Take two incoming matrices, and sum them","description_html":"\u003cp\u003eTake two incoming matrices, and sum them\u003c/p\u003e","function_template":"function y = your_fcn_name(x, x1)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx = [1 2; 3 4]; x1 = [4 3; 2 1];\r\ny_correct = 5*ones(2);\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = ones(3,5); x1 = x;\r\ny_correct = 2*x;\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = 1:10; x1 = 10:-1:1;\r\ny_correct = 11*ones(1,10);\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = magic(3); x1 = flipud(fliplr(x));\r\ny_correct = 10*ones(3);\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = [1 5 7 9]; x1 = [3 -5 6 15];\r\ny_correct = [4 0 13 24];\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n\r\n%%\r\nx = eye(4); x1 = fliplr(x);\r\ny_correct = [1,0,0,1;0,1,1,0;0,1,1,0;1,0,0,1];\r\nassert(isequal(your_fcn_name(x, x1),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":12852,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":177,"test_suite_updated_at":"2017-09-15T16:05:42.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-09-14T17:33:35.000Z","updated_at":"2026-02-11T18:29:09.000Z","published_at":"2017-09-14T17:33: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\u003eTake two incoming matrices, and sum them\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:\"basics\"","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:\"basics\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"basics\"","","\"","basics","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f7362001fe0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f7362001f40\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f7362001680\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f7362002260\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f73620021c0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f7362002120\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f7362002080\u003e":"tag:\"basics\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f7362002080\u003e":"tag:\"basics\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"basics\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"basics\"","","\"","basics","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f7362001fe0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f7362001f40\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f7362001680\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f7362002260\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f73620021c0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f7362002120\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f7362002080\u003e":"tag:\"basics\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f7362002080\u003e":"tag:\"basics\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":42526,"difficulty_rating":"easy"},{"id":43621,"difficulty_rating":"easy"},{"id":45936,"difficulty_rating":"easy"},{"id":44473,"difficulty_rating":"easy"},{"id":2068,"difficulty_rating":"easy"},{"id":42500,"difficulty_rating":"easy"},{"id":1791,"difficulty_rating":"easy"},{"id":44493,"difficulty_rating":"easy"},{"id":45927,"difficulty_rating":"easy"},{"id":45933,"difficulty_rating":"easy"},{"id":45930,"difficulty_rating":"easy"},{"id":43691,"difficulty_rating":"easy"},{"id":52148,"difficulty_rating":"easy"},{"id":44326,"difficulty_rating":"easy"},{"id":52133,"difficulty_rating":"easy"},{"id":43887,"difficulty_rating":"easy"},{"id":43980,"difficulty_rating":"easy"},{"id":47113,"difficulty_rating":"easy"},{"id":45909,"difficulty_rating":"easy"},{"id":44300,"difficulty_rating":"easy"},{"id":44092,"difficulty_rating":"easy"},{"id":44235,"difficulty_rating":"easy"},{"id":2880,"difficulty_rating":"easy"},{"id":53805,"difficulty_rating":"easy"},{"id":54860,"difficulty_rating":"easy"},{"id":44294,"difficulty_rating":"easy"},{"id":2798,"difficulty_rating":"easy"},{"id":2389,"difficulty_rating":"easy"},{"id":43689,"difficulty_rating":"easy"},{"id":43617,"difficulty_rating":"easy"},{"id":1449,"difficulty_rating":"easy"},{"id":43737,"difficulty_rating":"easy"},{"id":2924,"difficulty_rating":"easy"},{"id":52105,"difficulty_rating":"easy"},{"id":46763,"difficulty_rating":"easy"},{"id":2862,"difficulty_rating":"easy"},{"id":2980,"difficulty_rating":"easy"},{"id":44835,"difficulty_rating":"easy"},{"id":2864,"difficulty_rating":"easy"},{"id":43171,"difficulty_rating":"easy"},{"id":2912,"difficulty_rating":"easy"},{"id":2353,"difficulty_rating":"easy"},{"id":44330,"difficulty_rating":"easy"},{"id":1924,"difficulty_rating":"easy"},{"id":2857,"difficulty_rating":"easy"},{"id":1797,"difficulty_rating":"easy"},{"id":1792,"difficulty_rating":"easy"},{"id":45522,"difficulty_rating":"easy"},{"id":43627,"difficulty_rating":"easy"},{"id":44328,"difficulty_rating":"easy"}]}}