{"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":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":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":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":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":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":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":2865,"title":"Matlab Basics - Rounding I","description":"Write a script to round x DOWN to the next lowest integer:\r\n\r\ne.g. x = 2.3 --\u003e x = 2  also: x = 2.7 --\u003e x = 2","description_html":"\u003cp\u003eWrite a script to round x DOWN to the next lowest integer:\u003c/p\u003e\u003cp\u003ee.g. x = 2.3 --\u0026gt; x = 2  also: x = 2.7 --\u0026gt; x = 2\u003c/p\u003e","function_template":"function y = round_down(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(round_down(x),y_correct))\r\n%%\r\nx = 2.3;\r\ny_correct = 2;\r\nassert(isequal(round_down(x),y_correct))%%\r\nx = 13.7;\r\ny_correct = 13;\r\nassert(isequal(round_down(x),y_correct))","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":500,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:12:26.000Z","updated_at":"2026-03-29T20:37:35.000Z","published_at":"2015-01-22T19:28: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\u003eWrite a script to round x DOWN to the next lowest integer:\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 = 2.3 --\u0026gt; x = 2 also: x = 2.7 --\u0026gt; x = 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":2918,"title":"Matlab Basics II - Extract last 3 elements of a vector","description":"Let x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives those numbers for any vector x\r\n\r\nexample:\r\n\r\nx = [1 2 3 4]\r\n\r\noutput = [2 3 4]","description_html":"\u003cp\u003eLet x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives those numbers for any vector x\u003c/p\u003e\u003cp\u003eexample:\u003c/p\u003e\u003cp\u003ex = [1 2 3 4]\u003c/p\u003e\u003cp\u003eoutput = [2 3 4]\u003c/p\u003e","function_template":"function y = last_three(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [1 2 3 4];\r\ny_correct = [2 3 4];\r\nassert(isequal(last_three(x),y_correct))\r\n\r\n%%\r\nx = [5;2;8;6;7;2;3];\r\ny_correct = [7;2;3];\r\nassert(isequal(last_three(x),y_correct))\r\n\r\n%%\r\nx = [1.2 3.6 2.5 2.7 2.8 8.6 9.2 2.7 3.7 -4.9];\r\ny_correct = [2.7 3.7 -4.9];\r\nassert(isequal(last_three(x),y_correct))\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":262,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T22:26:22.000Z","updated_at":"2026-02-08T05:48:28.000Z","published_at":"2015-02-02T05:27: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\u003eLet x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives those numbers for any vector 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\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 = [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\u003eoutput = [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":2550,"title":"Evaluating a polynomial","description":"Given the following polynomial and the value for x, determine y.\r\n\r\n y = 3x^5 – x^3 + 8x – 3 \r\n\r\nExample\r\n\r\n x = 1\r\n y = 3 - 1 + 8 - 3 = 7","description_html":"\u003cp\u003eGiven the following polynomial and the value for x, determine y.\u003c/p\u003e\u003cpre\u003e y = 3x^5 – x^3 + 8x – 3 \u003c/pre\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e x = 1\r\n y = 3 - 1 + 8 - 3 = 7\u003c/pre\u003e","function_template":"function y = equation(x)\r\n  y = …;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 7;\r\nassert(isequal(equation(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 9287;\r\nassert(isequal(equation(x),y_correct))\r\n\r\n%%\r\nx = 0;\r\ny_correct = -3;\r\nassert(isequal(equation(x),y_correct))\r\n\r\n%%\r\nx = -3;\r\ny_correct = -729;\r\nassert(isequal(equation(x),y_correct))\r\n\r\n%%\r\nx = -sqrt(-1);\r\ny_correct = -3 - 12*sqrt(-1);\r\nassert(isequal(equation(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":27815,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":381,"test_suite_updated_at":"2014-09-04T20:55:51.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-09-03T19:24:21.000Z","updated_at":"2026-02-15T15:02:10.000Z","published_at":"2014-09-03T19:24: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\u003eGiven the following polynomial and the value for x, determine y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ y = 3x^5 – x^3 + 8x – 3]]\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\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x = 1\\n y = 3 - 1 + 8 - 3 = 7]]\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":2549,"title":"length of a vector","description":"Find twice the length of a given vector.","description_html":"\u003cp\u003eFind twice the length of a given vector.\u003c/p\u003e","function_template":"function y = length_of_vector(x)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx=1;\r\ny_correct = 2;\r\nassert(isequal(length_of_vector(x),y_correct))\r\n\r\n%%\r\nx=[1 2 3];\r\ny_correct = 6;\r\nassert(isequal(length_of_vector(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":27815,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":778,"test_suite_updated_at":"2014-09-03T19:42:51.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-09-03T19:10:03.000Z","updated_at":"2026-02-24T00:52:13.000Z","published_at":"2014-09-03T19:10: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\u003eFind twice the length of a given 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":2914,"title":"Matlab Basics II - Count rows in a matrix","description":"Write a function that returns that number of rows in a vector or matrix x\r\n\r\nexample:\r\nx = [1; 2; 3]\r\n\r\noutput = 3","description_html":"\u003cp\u003eWrite a function that returns that number of rows in a vector or matrix x\u003c/p\u003e\u003cp\u003eexample:\r\nx = [1; 2; 3]\u003c/p\u003e\u003cp\u003eoutput = 3\u003c/p\u003e","function_template":"function y = count_rows(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(count_rows(x),y_correct))\r\n\r\n%%\r\nx = [1 2 2; 15 3 4];\r\ny_correct = 2;\r\nassert(isequal(count_rows(x),y_correct))\r\n\r\n%%\r\nx = [3.1 7.2;5.4 2.2;7 2.1;5 8.6];\r\ny_correct = 4;\r\nassert(isequal(count_rows(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":405,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T21:38:43.000Z","updated_at":"2026-02-09T14:20:36.000Z","published_at":"2015-02-02T05:25:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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 returns that number of rows in a vector or matrix 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\u003eexample: x = [1; 2; 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\u003eoutput = 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":2991,"title":"Finding an element in a vector","description":"x is a vector of unknown length\r\n\r\nyour function should return the index of the first element in the vector that is greater than 6. If all elements in x are less than 6, the function should return 'none'\r\n\r\nexample: x = [1 2 7 2 3 2 4 8 6]\r\n\r\noutput = 3","description_html":"\u003cp\u003ex is a vector of unknown length\u003c/p\u003e\u003cp\u003eyour function should return the index of the first element in the vector that is greater than 6. If all elements in x are less than 6, the function should return 'none'\u003c/p\u003e\u003cp\u003eexample: x = [1 2 7 2 3 2 4 8 6]\u003c/p\u003e\u003cp\u003eoutput = 3\u003c/p\u003e","function_template":"function ind = first_six(x)\r\n  \r\nend","test_suite":"%%\r\nx = [1 2 7 2 3 2 4 8 6];\r\ny_correct = 3;\r\nassert(isequal(first_six(x),y_correct))\r\n%%\r\nx = [2 1 4 1 2 10 9 4 12 1 6 5 10 10 3 6 6 8 9 10];\r\ny_correct = 6;\r\nassert(isequal(first_six(x),y_correct))\r\n%%\r\nx = [4 2 3 4 5 5 3 1 1 2];\r\ny_correct = 'none';\r\nassert(isequal(first_six(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":204,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-09T23:35:55.000Z","updated_at":"2026-03-28T01:30:09.000Z","published_at":"2015-02-09T23:35: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\",\"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 a vector of unknown length\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\u003eyour function should return the index of the first element in the vector that is greater than 6. If all elements in x are less than 6, the function should return 'none'\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: x = [1 2 7 2 3 2 4 8 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\u003eoutput = 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":2917,"title":"Matlab Basics II - Intervals","description":"Write a function that takes an interval from a to b, and divides it into 5 parts\r\n\r\nexample:\r\n\r\na = 1, b = 2\r\n\r\noutput = 1 1.25 1.5 1.75 2","description_html":"\u003cp\u003eWrite a function that takes an interval from a to b, and divides it into 5 parts\u003c/p\u003e\u003cp\u003eexample:\u003c/p\u003e\u003cp\u003ea = 1, b = 2\u003c/p\u003e\u003cp\u003eoutput = 1 1.25 1.5 1.75 2\u003c/p\u003e","function_template":"function y = split_to_five(a,b)\r\n  y = ;\r\nend","test_suite":"%%\r\na = 1; b=2;\r\ny_correct = [1 1.25 1.5 1.75 2];\r\nassert(isequal(split_to_five(a,b),y_correct))\r\n\r\n%%\r\na = 20; b=30;\r\ny_correct = [20 22.5 25 27.5 30];\r\nassert(isequal(split_to_five(a,b),y_correct))\r\n\r\n%%\r\na = 30; b=-20;\r\ny_correct = [30 17.5 5 -7.5 -20];\r\nassert(isequal(split_to_five(a,b),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":328,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T22:18:24.000Z","updated_at":"2026-03-29T20:39:32.000Z","published_at":"2015-02-02T05:26:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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 an interval from a to b, and divides it into 5 parts\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\u003ea = 1, b = 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\u003eoutput = 1 1.25 1.5 1.75 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":2863,"title":"Matlab Basics - Set unwanted parts of a vector to zero","description":"Consider a vector x, of length \u003e= 7, write a script to set elements 2, 5, and 6 to zero.\r\n\r\nExample\r\n\r\n x = [1 2 3 4 5 6 7] --\u003e x = [1 0 3 4 0 0 7]","description_html":"\u003cp\u003eConsider a vector x, of length \u0026gt;= 7, write a script to set elements 2, 5, and 6 to zero.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e x = [1 2 3 4 5 6 7] --\u0026gt; x = [1 0 3 4 0 0 7]\u003c/pre\u003e","function_template":"function x = set_2_5_6_to_zero(x)\r\n  \r\nend","test_suite":"%%\r\nx = [1 2 3 4 5 6 7];\r\nx_cor = [1 0 3 4 0 0 7];\r\nassert(isequal(set_2_5_6_to_zero(x),x_cor))\r\n%%\r\nx = [3 5 7 2 8 9 12 22 13 17 6];\r\nx_cor = [3 0 7 2 0 0 12 22 13 17 6];\r\nassert(isequal(set_2_5_6_to_zero(x),x_cor))%%\r\nx = [12.2 16.5 13.2 2.5 9.7 7.6 3.1 1.4];\r\nx_cor = [12.2 0 13.2 2.5 0 0 3.1 1.4];\r\nassert(isequal(set_2_5_6_to_zero(x),x_cor))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":261,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:02:53.000Z","updated_at":"2026-02-12T15:30:57.000Z","published_at":"2015-01-22T19:29:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConsider a vector x, of length \u0026gt;= 7, write a script to set elements 2, 5, and 6 to zero.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x = [1 2 3 4 5 6 7] --\u003e x = [1 0 3 4 0 0 7]]]\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":2868,"title":"Matlab Basics - y as a function of x","description":"Write a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2","description_html":"\u003cp\u003eWrite a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2\u003c/p\u003e","function_template":"function y = y_fun_1(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 9;\r\nassert(isequal(y_fun_1(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 67;\r\nassert(isequal(y_fun_1(x),y_correct))\r\n%%\r\nx = 3.2;\r\ny_correct = 75.440000000000010;\r\nassert(isequal(y_fun_1(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":527,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:20:52.000Z","updated_at":"2026-03-28T01:23:21.000Z","published_at":"2015-01-22T19:26:05.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 calculate y as a function of x, such that y = 6x^2 + 5x - 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":2911,"title":"Matlab Basics II - squares","description":"Write a function that takes matrix A, and squares each element in the matrix\r\n\r\nexample:\r\nA = [1 2 3]\r\n\r\noutput = [1 4 9]","description_html":"\u003cp\u003eWrite a function that takes matrix A, and squares each element in the matrix\u003c/p\u003e\u003cp\u003eexample:\r\nA = [1 2 3]\u003c/p\u003e\u003cp\u003eoutput = [1 4 9]\u003c/p\u003e","function_template":"function y = square_elements(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2 3];\r\ny_correct = [1 4 9];\r\nassert(isequal(square_elements(x),y_correct))\r\n\r\n%%\r\nx = [33 44 5; 56 20 12];\r\ny_correct = [1089 1936 25;3136 400 144];\r\nassert(isequal(square_elements(x),y_correct))\r\n\r\n%%\r\nx=[3.3 4.4 5; 5.6 2.0 1.2];\r\ny_correct = [10.889999999999999 19.360000000000003 25; 31.359999999999996 4 1.440000000000000];\r\nassert(isequal(square_elements(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":480,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T20:38:40.000Z","updated_at":"2026-02-09T14:25:55.000Z","published_at":"2015-02-02T05:24: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\",\"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 matrix A, and squares each element in the 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eexample: A = [1 2 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\u003eoutput = [1 4 9]\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":2858,"title":"Matlab Basics - Logical Tests I","description":"Write a script to test whether a year number is for a leap year or not.\r\n\r\neg. x = 1884\r\noutput = 1\r\n\r\neg. x = 3\r\noutput = 0","description_html":"\u003cp\u003eWrite a script to test whether a year number is for a leap year or not.\u003c/p\u003e\u003cp\u003eeg. x = 1884\r\noutput = 1\u003c/p\u003e\u003cp\u003eeg. x = 3\r\noutput = 0\u003c/p\u003e","function_template":"function y = leap(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1884;\r\ny = 1;\r\nassert(isequal(leap(x),y))\r\n%%\r\nx = 3;\r\ny = 0;\r\nassert(isequal(leap(x),y))\r\n%%\r\nx = 522;\r\ny = 0;\r\nassert(isequal(leap(x),y))\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":270,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-20T19:35:57.000Z","updated_at":"2026-02-16T12:13:28.000Z","published_at":"2015-01-22T19:33:44.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 test whether a year number is for a leap year or not.\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. x = 1884 output = 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\u003eeg. x = 3 output = 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":2904,"title":"Matlab Basics II - 3 Dimensional Arrays","description":"Assume x is a 3D array with n pages, representing students in a class, for each student (page in the array, the 3rd dimension), their grades are reported in two columns: Total Grade \u0026 Percent Grade. The rows of the student's page represent Math, Physics, Chemistry, and Biology in that order.\r\n\r\nWrite a function that extracts a student's Percent Grade in Physics given the student's number (n)","description_html":"\u003cp\u003eAssume x is a 3D array with n pages, representing students in a class, for each student (page in the array, the 3rd dimension), their grades are reported in two columns: Total Grade \u0026 Percent Grade. The rows of the student's page represent Math, Physics, Chemistry, and Biology in that order.\u003c/p\u003e\u003cp\u003eWrite a function that extracts a student's Percent Grade in Physics given the student's number (n)\u003c/p\u003e","function_template":"function y = phy_grade(x,n)\r\n  y = ;\r\nend","test_suite":"%%\r\nx(:,:,3) = [48,96;40,80;42,84;45,90];\r\nx(:,:,2) = [42,84;36,72;40,80;42,84];\r\nn = 2\r\ny_correct = 72;\r\nassert(isequal(phy_grade(x,n),y_correct))\r\n\r\n%%\r\nx(:,:,3) = [3,6;32,64;42,84;45,90];\r\nn = 3\r\ny_correct = 64;\r\nassert(isequal(phy_grade(x,n),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":34237,"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-01-30T22:10:33.000Z","updated_at":"2026-02-17T09:12:47.000Z","published_at":"2015-02-02T05:23:54.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAssume x is a 3D array with n pages, representing students in a class, for each student (page in the array, the 3rd dimension), their grades are reported in two columns: Total Grade \u0026amp; Percent Grade. The rows of the student's page represent Math, Physics, Chemistry, and Biology in that order.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that extracts a student's Percent Grade in Physics given the student's number (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":2990,"title":"Replace every 3rd element in a vector with 4","description":"x is a vector of undetermined length\r\n\r\nYou are to replace every 3rd element with the number 4, example:\r\n\r\nx = [11 23 34 43 2 31 6 34 5 45 26 7 78];\r\n\r\noutput = [11 23 *4* 43 2 *4* 6 34 *4* 45 26 *4* 78];\r\n\r\nMake sure the code accounts for varying vector lengths","description_html":"\u003cp\u003ex is a vector of undetermined length\u003c/p\u003e\u003cp\u003eYou are to replace every 3rd element with the number 4, example:\u003c/p\u003e\u003cp\u003ex = [11 23 34 43 2 31 6 34 5 45 26 7 78];\u003c/p\u003e\u003cp\u003eoutput = [11 23 \u003cb\u003e4\u003c/b\u003e 43 2 \u003cb\u003e4\u003c/b\u003e 6 34 \u003cb\u003e4\u003c/b\u003e 45 26 \u003cb\u003e4\u003c/b\u003e 78];\u003c/p\u003e\u003cp\u003eMake sure the code accounts for varying vector lengths\u003c/p\u003e","function_template":"function x = every_3rd_element(x)\r\n  \r\nend","test_suite":"%%\r\nx = [11 23 34 43 2 31 6 34 5 45 26 7 78];\r\ny_correct = [11 23 4 43 2 4 6 34 4 45 26 4 78];\r\nassert(isequal(every_3rd_element(x),y_correct))\r\n\r\n%%\r\nx = [82\t91 13 92 64 10 28 55 96 97 16 98 96 49 81 15 43 92 80 96 66 4 85 94 68 76 75 40 66 18];\r\ny_correct = [82\t91 4 92 64 4 28 55 4 97 16 4 96 49 4 15 43 4 80 96 4 4 85 4 68 76 4 40 66 4];\r\nassert(isequal(every_3rd_element(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":265,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-09T23:16:18.000Z","updated_at":"2026-02-17T14:29:02.000Z","published_at":"2015-02-09T23:16:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003ex is a vector of undetermined length\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\u003eYou are to replace every 3rd element with the number 4, example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex = [11 23 34 43 2 31 6 34 5 45 26 7 78];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput = [11 23\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\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 43 2\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\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 6 34\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\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 45 26\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\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 78];\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\u003eMake sure the code accounts for varying vector lengths\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":2856,"title":"Matlab Basics - Create a row vector","description":"Write a Matlab script to create a row vector of 10 consecutive numbers\r\nx = [1 2 3 4 5 6 7 8 9 10]","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 408px 25.5px; transform-origin: 408px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a Matlab script to create a row vector of 10 consecutive numbers\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ex = [1 2 3 4 5 6 7 8 9 10]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function x = create_row()\r\n  x = 1:10;\r\nend","test_suite":"%%\r\nassert(isequal(diff(create_row) ,ones(1,9)))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":8,"created_by":34237,"edited_by":3348724,"edited_at":"2025-12-19T21:22:30.000Z","deleted_by":null,"deleted_at":null,"solvers_count":317,"test_suite_updated_at":"2025-12-19T21:22:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-20T19:21:30.000Z","updated_at":"2026-03-31T09:56:09.000Z","published_at":"2015-01-22T19:35:13.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\u003eWrite a Matlab script to create a row vector of 10 consecutive numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex = [1 2 3 4 5 6 7 8 9 10]\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":2927,"title":"Matlab Basics II - Max \u0026 Index of Max","description":"Write a function that takes a vector x, then returns both the max value in x and its location in the vector\r\n\r\nfor example\r\n\r\nx = [1 4 5 2 3]\r\n\r\noutput: [5,3]","description_html":"\u003cp\u003eWrite a function that takes a vector x, then returns both the max value in x and its location in the vector\u003c/p\u003e\u003cp\u003efor example\u003c/p\u003e\u003cp\u003ex = [1 4 5 2 3]\u003c/p\u003e\u003cp\u003eoutput: [5,3]\u003c/p\u003e","function_template":"function out = max_ind_max(x)\r\n  \r\nend","test_suite":"%%\r\nx = [1 4 5 2 3];\r\ny_correct = [5,3];\r\nassert(isequal(max_ind_max(x),y_correct))\r\n\r\n%%\r\nx = [3.2 4.3 -9.8 4.7 -10.9 3.7 -2.5];\r\ny_correct = [4.7,4];\r\nassert(isequal(max_ind_max(x),y_correct))","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":266,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-02T03:52:25.000Z","updated_at":"2026-03-28T01:25:44.000Z","published_at":"2015-02-02T05:29: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\u003eWrite a function that takes a vector x, then returns both the max value in x and its location in the vector\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\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 4 5 2 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\u003eoutput: [5,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":2916,"title":"Matlab Basics II - Log and natural log","description":"Write a function that calculates the difference between the log and natural log of a vector, to two decimal places\r\n\r\nexample:\r\n\r\nx = [10, 100, 1000]\r\n\r\noutput = [1.3 2.61 3.91]","description_html":"\u003cp\u003eWrite a function that calculates the difference between the log and natural log of a vector, to two decimal places\u003c/p\u003e\u003cp\u003eexample:\u003c/p\u003e\u003cp\u003ex = [10, 100, 1000]\u003c/p\u003e\u003cp\u003eoutput = [1.3 2.61 3.91]\u003c/p\u003e","function_template":"function y = logarithms(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [10 100 1000];\r\ny_correct = [1.30 2.61 3.91];\r\nassert(isequal(logarithms(x),y_correct))\r\n\r\n%%\r\nx = [50 1.2 4567; 200 67 820];;\r\ny_correct = [2.21 0.10 4.77; 3 2.38 3.8];\r\nassert(isequal(logarithms(x),y_correct))\r\n\r\n%%\r\nx = [0.5 1.2 4.5; 23 33 3.3];\r\ny_correct = [-0.39 0.1 0.85; 1.77 1.98 0.68];\r\nassert(isequal(logarithms(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":193,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T22:14:43.000Z","updated_at":"2026-03-02T15:20:04.000Z","published_at":"2015-02-02T05:26:28.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 calculates the difference between the log and natural log of a vector, to two decimal places\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 = [10, 100, 1000]\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 = [1.3 2.61 3.91]\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":2849,"title":"Matlab Basics - Assigning Variables","description":"Assign different types of data to variables: integer, double, and strings\r\n\r\nExample:\r\nA is a double, for example 2.34\r\n\r\nB is an integer, for example 17\r\n\r\nC is a string, for example \"hello\"","description_html":"\u003cp\u003eAssign different types of data to variables: integer, double, and strings\u003c/p\u003e\u003cp\u003eExample:\r\nA is a double, for example 2.34\u003c/p\u003e\u003cp\u003eB is an integer, for example 17\u003c/p\u003e\u003cp\u003eC is a string, for example \"hello\"\u003c/p\u003e","function_template":"function y = \r\n  A = ;\r\n  B = ;\r\n  C = ;\r\nend","test_suite":"%%\r\nA = 2.34;\r\nassert(isequal(class(A),'double'))\r\n%%\r\nB = int64(17);\r\nassert(isequal(class(B),'int8')||isequal(class(B),'int16')||isequal(class(B),'int32')||isequal(class(B),'int64'))\r\n%%\r\nC = 'hello';\r\nassert(isequal(class(C),'char'))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":34237,"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":"2015-01-19T19:38:17.000Z","updated_at":"2026-03-04T15:45:43.000Z","published_at":"2015-01-22T19:24: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\u003eAssign different types of data to variables: integer, double, and strings\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: A is a double, for example 2.34\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\u003eB is an integer, for example 17\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\u003eC is a string, for example \\\"hello\\\"\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":2925,"title":"Matlab Basics II - Create a vector with a repeated entry","description":"Create a row vector of length n, filled with 4's, for example, if n = 3\r\n\r\noutput = [4 4 4]\r\n\r\nmake sure to round UP when n is a decimal, and take the absolute value when n is negative","description_html":"\u003cp\u003eCreate a row vector of length n, filled with 4's, for example, if n = 3\u003c/p\u003e\u003cp\u003eoutput = [4 4 4]\u003c/p\u003e\u003cp\u003emake sure to round UP when n is a decimal, and take the absolute value when n is negative\u003c/p\u003e","function_template":"function y = fours(n)\r\n  y = \r\nend","test_suite":"%%\r\nn = 3;\r\ny_correct = [4 4 4];\r\nassert(isequal(fours(n),y_correct))\r\n\r\n%%\r\nn = 5.5;\r\ny_correct = [4 4 4 4 4 4];\r\nassert(isequal(fours(n),y_correct))\r\n\r\n%%\r\nn = 7;\r\ny_correct = [4 4 4 4 4 4 4];\r\nassert(isequal(fours(n),y_correct))\r\n\r\n%%\r\nn = -2;\r\ny_correct = [4 4];\r\nassert(isequal(fours(n),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":252,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-02T03:41:00.000Z","updated_at":"2026-02-18T11:02:49.000Z","published_at":"2015-02-02T05:29:08.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate a row vector of length n, filled with 4's, for example, if n = 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\u003eoutput = [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\u003emake sure to round UP when n is a decimal, and take the absolute value when n is negative\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":2926,"title":"Matlab Basics II - Minimum","description":"Write a function that returns the minimum of each ROW of a matrix x\r\n\r\nexample: x = [1 2 3; 4 5 6];\r\n\r\noutput [1;4];","description_html":"\u003cp\u003eWrite a function that returns the minimum of each ROW of a matrix x\u003c/p\u003e\u003cp\u003eexample: x = [1 2 3; 4 5 6];\u003c/p\u003e\u003cp\u003eoutput [1;4];\u003c/p\u003e","function_template":"function y = min_per_row(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [1 2 3;4 5 6];\r\ny_correct = [1;4];\r\nassert(isequal(min_per_row(x),y_correct))\r\n\r\n%%\r\nx = [7.2 -2.5 5.1;4.2 -9.8 3.6];\r\ny_correct = [-2.5;-9.8];\r\nassert(isequal(min_per_row(x),y_correct))\r\n\r\n%%\r\nx = [pi exp(1) pi/2;3 pi 4];\r\ny_correct = [pi/2;3];\r\nassert(isequal(min_per_row(x),y_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":398,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-02T03:47:26.000Z","updated_at":"2026-02-18T14:58:00.000Z","published_at":"2015-02-02T05:29: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\u003eWrite a function that returns the minimum of each ROW of a matrix 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\u003eexample: x = [1 2 3; 4 5 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\u003eoutput [1;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":2915,"title":"Matlab Basics II - Find the roots of a function","description":"Write a function that finds where a curve crosses zero (the x-axis) to two decimal places\r\n\r\nExample: \r\n\r\n\u003c\u003chttp://s14.postimg.org/vibfltgyl/cody2.png\u003e\u003e\r\n\r\noutput:\r\n\r\n   [0 ; 1.13 ;  -0.53]","description_html":"\u003cp\u003eWrite a function that finds where a curve crosses zero (the x-axis) to two decimal places\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cimg src = \"http://s14.postimg.org/vibfltgyl/cody2.png\"\u003e\u003cp\u003eoutput:\u003c/p\u003e\u003cpre\u003e   [0 ; 1.13 ;  -0.53]\u003c/pre\u003e","function_template":"function y = cross_zero(x)\r\n  y = \r\n\r\nend","test_suite":"%%\r\nx = [5 -3 -3 0];\r\ny_correct = [0;1.13;-0.53];\r\nassert(isequal(cross_zero(x),y_correct))\r\n\r\n%%\r\nx = [1 2 3 4 5];\r\ny_correct = [0.29 + 1.42i; 0.29 - 1.42i; -1.29 + 0.86i; -1.29 - 0.86i];\r\nassert(isequal(cross_zero(x),y_correct))\r\n\r\n%%\r\nx = [2 5 0 -4 0];\r\ny_correct = [0; -2; -1.28; 0.78];\r\nassert(isequal(cross_zero(x),y_correct))","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":92,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T22:01:50.000Z","updated_at":"2026-02-12T18:18:15.000Z","published_at":"2015-02-02T05:26:07.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\u003eWrite a function that finds where a curve crosses zero (the x-axis) to two decimal places\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: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\u003eoutput:\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[   [0 ; 1.13 ;  -0.53]]]\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,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEV4eHiTk5P29vaBgYGcnJzAwMC3t7eKiorS0tLt7e3b29vk5OTJycn///9vb28AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD61b95AAAAyklEQVR42q2SSQ6FIAxAWzQxkcj976lEE5R+hojQOmw+Cxa8RwcoGnhf6oNDD0AvGL8j/E2wC+JiXwSaAKbbatGkLjBrX13szynmtPXnKc2eCRiMGQtXxrq2hmZRuuXx6SVdPlPpopeC387sFMMIwdsyAMFAEcHuptW5oIaKYgjHBBoZ512snMeJ8g7o0DmA5jwKXRdqy9W6gfMzhd7iMOySlxq0qn/z4leR43HNQ8WrLtYi1Dz+pnjsmt/8ZsulwLgQOOeC4EyQHH5z1GUZiLNTtwAAAABJRU5ErkJggg==\"}]}"},{"id":2913,"title":"Matlab Basics II - Velocity of a particle","description":"A particle is moving in space, such that it's velocity is given by:\r\n\r\n\u003c\u003chttp://s30.postimg.org/5rf1xtvj5/cody1.png\u003e\u003e\r\n\r\nwrite a function that calculates velocity based on position (x) and time(t)","description_html":"\u003cp\u003eA particle is moving in space, such that it's velocity is given by:\u003c/p\u003e\u003cimg src = \"http://s30.postimg.org/5rf1xtvj5/cody1.png\"\u003e\u003cp\u003ewrite a function that calculates velocity based on position (x) and time(t)\u003c/p\u003e","function_template":"function v = particle_vel(x,t)\r\n  v = \r\nend","test_suite":"%%\r\nx = 2.1;\r\nt = 4.2;\r\nv_correct = 23.849128073359125;\r\nassert(isequal(particle_vel(x,t),v_correct))\r\n\r\n%%\r\nx = -5.3;\r\nt = 6.8;\r\nv_correct = -22.273808521444963;\r\nassert(isequal(particle_vel(x,t),v_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":7,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":154,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T21:03:37.000Z","updated_at":"2026-02-12T18:13:23.000Z","published_at":"2015-02-02T05:25:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eA particle is moving in space, such that it's velocity is 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\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\u003ewrite a function that calculates velocity based on position (x) and time(t)\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,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEV4eHiTk5P29vaBgYGcnJzAwMC3t7eKiorS0tLt7e3b29vk5OTJycn///9vb28AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD61b95AAAAyklEQVR42q2SSQ6FIAxAWzQxkcj976lEE5R+hojQOmw+Cxa8RwcoGnhf6oNDD0AvGL8j/E2wC+JiXwSaAKbbatGkLjBrX13szynmtPXnKc2eCRiMGQtXxrq2hmZRuuXx6SVdPlPpopeC387sFMMIwdsyAMFAEcHuptW5oIaKYgjHBBoZ512snMeJ8g7o0DmA5jwKXRdqy9W6gfMzhd7iMOySlxq0qn/z4leR43HNQ8WrLtYi1Dz+pnjsmt/8ZsulwLgQOOeC4EyQHH5z1GUZiLNTtwAAAABJRU5ErkJggg==\"}]}"},{"id":2866,"title":"Matlab Basics - Rounding II","description":"Write a script to round a variable x to 3 decimal places:\r\n\r\ne.g. x = 2.3456 --\u003e y = 2.346","description_html":"\u003cp\u003eWrite a script to round a variable x to 3 decimal places:\u003c/p\u003e\u003cp\u003ee.g. x = 2.3456 --\u0026gt; y = 2.346\u003c/p\u003e","function_template":"function y = round_3_d_p(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1.000;\r\nassert(isequal(round_3_d_p(x),y_correct))\r\n%%\r\nx = 2.3456;\r\ny_correct = 2.346;\r\nassert(isequal(round_3_d_p(x),y_correct))\r\n%%\r\nx = 16.2683254;\r\ny_correct = 16.268;\r\nassert(isequal(round_3_d_p(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":24,"comments_count":3,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5635,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:15:01.000Z","updated_at":"2026-04-01T21:36:22.000Z","published_at":"2015-01-22T19:28: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\u003eWrite a script to round a variable x to 3 decimal places:\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 = 2.3456 --\u0026gt; y = 2.346\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":2850,"title":"Matlab Basics - Switching Assignments","description":"Switch assignments for variables x and y, for example\r\n\r\nstart with x = 1 and y = 3\r\nend with y = 1 and x = 3\r\n\r\nDo NOT simply re-assign variables, use a temporary variable 'z'","description_html":"\u003cp\u003eSwitch assignments for variables x and y, for example\u003c/p\u003e\u003cp\u003estart with x = 1 and y = 3\r\nend with y = 1 and x = 3\u003c/p\u003e\u003cp\u003eDo NOT simply re-assign variables, use a temporary variable 'z'\u003c/p\u003e","function_template":"function [x,y] = swap_vars(x,y)\r\n  z = ;\r\nend","test_suite":"%%\r\n[x,y] = swap_vars(5,10);\r\nassert(isequal(x,10));\r\nassert(isequal(y,5));\r\n%%\r\n[x,y] = swap_vars('hello','bye');\r\nassert(isequal(x,'bye'));\r\nassert(isequal(y,'hello'));\r\n%%\r\n[x,y] = swap_vars(5,'hello');\r\nassert(isequal(x,'hello'));\r\nassert(isequal(y,5));","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":505,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-19T19:54:02.000Z","updated_at":"2026-02-14T13:02:40.000Z","published_at":"2015-01-22T19:24:28.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\u003eSwitch assignments for variables x and y, 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\u003estart with x = 1 and y = 3 end with y = 1 and x = 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\u003eDo NOT simply re-assign variables, use a temporary variable 'z'\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":2867,"title":"Matlab Basics - Rounding III","description":"Write a script to round a large number to the nearest 10,000\r\n\r\ne.g. x = 12,358,466,243 --\u003e y = 12,358,470,000","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 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: 190px 8px; transform-origin: 190px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a script to round a large number to the nearest 10,000\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: 149.5px 8px; transform-origin: 149.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ee.g. x = 12,358,466,243 --\u0026gt; y = 12,358,470,000\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = round_ten_thou(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 12358466243;\r\ny_correct = 12358470000;\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = -1235846.325;\r\ny_correct = -1240000;\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = 1266243.325;\r\ny_correct = 1270000;\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = 987654321;\r\ny_correct = 987650000;\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = [1:4999];\r\ny_correct = zeros(1,4999);\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = [];\r\nassert(isempty(round_ten_thou(x)))\r\n%%\r\nx = [-5001:-1:-6000];\r\ny_correct = -1e4*ones(1,1e3);\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = -54321.67890;\r\ny_correct = -5e4;\r\nassert(isequal(round_ten_thou(x),y_correct))","published":true,"deleted":false,"likes_count":29,"comments_count":7,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5179,"test_suite_updated_at":"2021-05-09T15:34:34.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:19:47.000Z","updated_at":"2026-04-01T21:37:46.000Z","published_at":"2015-01-22T19:27:53.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\u003eWrite a script to round a large number to the nearest 10,000\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 = 12,358,466,243 --\u0026gt; y = 12,358,470,000\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"errors":[],"problems":[{"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":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":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":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":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":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":2865,"title":"Matlab Basics - Rounding I","description":"Write a script to round x DOWN to the next lowest integer:\r\n\r\ne.g. x = 2.3 --\u003e x = 2  also: x = 2.7 --\u003e x = 2","description_html":"\u003cp\u003eWrite a script to round x DOWN to the next lowest integer:\u003c/p\u003e\u003cp\u003ee.g. x = 2.3 --\u0026gt; x = 2  also: x = 2.7 --\u0026gt; x = 2\u003c/p\u003e","function_template":"function y = round_down(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(round_down(x),y_correct))\r\n%%\r\nx = 2.3;\r\ny_correct = 2;\r\nassert(isequal(round_down(x),y_correct))%%\r\nx = 13.7;\r\ny_correct = 13;\r\nassert(isequal(round_down(x),y_correct))","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":500,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:12:26.000Z","updated_at":"2026-03-29T20:37:35.000Z","published_at":"2015-01-22T19:28: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\u003eWrite a script to round x DOWN to the next lowest integer:\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 = 2.3 --\u0026gt; x = 2 also: x = 2.7 --\u0026gt; x = 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":2918,"title":"Matlab Basics II - Extract last 3 elements of a vector","description":"Let x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives those numbers for any vector x\r\n\r\nexample:\r\n\r\nx = [1 2 3 4]\r\n\r\noutput = [2 3 4]","description_html":"\u003cp\u003eLet x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives those numbers for any vector x\u003c/p\u003e\u003cp\u003eexample:\u003c/p\u003e\u003cp\u003ex = [1 2 3 4]\u003c/p\u003e\u003cp\u003eoutput = [2 3 4]\u003c/p\u003e","function_template":"function y = last_three(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [1 2 3 4];\r\ny_correct = [2 3 4];\r\nassert(isequal(last_three(x),y_correct))\r\n\r\n%%\r\nx = [5;2;8;6;7;2;3];\r\ny_correct = [7;2;3];\r\nassert(isequal(last_three(x),y_correct))\r\n\r\n%%\r\nx = [1.2 3.6 2.5 2.7 2.8 8.6 9.2 2.7 3.7 -4.9];\r\ny_correct = [2.7 3.7 -4.9];\r\nassert(isequal(last_three(x),y_correct))\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":262,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T22:26:22.000Z","updated_at":"2026-02-08T05:48:28.000Z","published_at":"2015-02-02T05:27: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\u003eLet x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives those numbers for any vector 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\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 = [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\u003eoutput = [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":2550,"title":"Evaluating a polynomial","description":"Given the following polynomial and the value for x, determine y.\r\n\r\n y = 3x^5 – x^3 + 8x – 3 \r\n\r\nExample\r\n\r\n x = 1\r\n y = 3 - 1 + 8 - 3 = 7","description_html":"\u003cp\u003eGiven the following polynomial and the value for x, determine y.\u003c/p\u003e\u003cpre\u003e y = 3x^5 – x^3 + 8x – 3 \u003c/pre\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e x = 1\r\n y = 3 - 1 + 8 - 3 = 7\u003c/pre\u003e","function_template":"function y = equation(x)\r\n  y = …;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 7;\r\nassert(isequal(equation(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 9287;\r\nassert(isequal(equation(x),y_correct))\r\n\r\n%%\r\nx = 0;\r\ny_correct = -3;\r\nassert(isequal(equation(x),y_correct))\r\n\r\n%%\r\nx = -3;\r\ny_correct = -729;\r\nassert(isequal(equation(x),y_correct))\r\n\r\n%%\r\nx = -sqrt(-1);\r\ny_correct = -3 - 12*sqrt(-1);\r\nassert(isequal(equation(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":27815,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":381,"test_suite_updated_at":"2014-09-04T20:55:51.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2014-09-03T19:24:21.000Z","updated_at":"2026-02-15T15:02:10.000Z","published_at":"2014-09-03T19:24: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\u003eGiven the following polynomial and the value for x, determine y.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ y = 3x^5 – x^3 + 8x – 3]]\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\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x = 1\\n y = 3 - 1 + 8 - 3 = 7]]\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":2549,"title":"length of a vector","description":"Find twice the length of a given vector.","description_html":"\u003cp\u003eFind twice the length of a given vector.\u003c/p\u003e","function_template":"function y = length_of_vector(x)\r\n  y = ...;\r\nend","test_suite":"%%\r\nx=1;\r\ny_correct = 2;\r\nassert(isequal(length_of_vector(x),y_correct))\r\n\r\n%%\r\nx=[1 2 3];\r\ny_correct = 6;\r\nassert(isequal(length_of_vector(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":27815,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":778,"test_suite_updated_at":"2014-09-03T19:42:51.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2014-09-03T19:10:03.000Z","updated_at":"2026-02-24T00:52:13.000Z","published_at":"2014-09-03T19:10: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\u003eFind twice the length of a given 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":2914,"title":"Matlab Basics II - Count rows in a matrix","description":"Write a function that returns that number of rows in a vector or matrix x\r\n\r\nexample:\r\nx = [1; 2; 3]\r\n\r\noutput = 3","description_html":"\u003cp\u003eWrite a function that returns that number of rows in a vector or matrix x\u003c/p\u003e\u003cp\u003eexample:\r\nx = [1; 2; 3]\u003c/p\u003e\u003cp\u003eoutput = 3\u003c/p\u003e","function_template":"function y = count_rows(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(count_rows(x),y_correct))\r\n\r\n%%\r\nx = [1 2 2; 15 3 4];\r\ny_correct = 2;\r\nassert(isequal(count_rows(x),y_correct))\r\n\r\n%%\r\nx = [3.1 7.2;5.4 2.2;7 2.1;5 8.6];\r\ny_correct = 4;\r\nassert(isequal(count_rows(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":405,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T21:38:43.000Z","updated_at":"2026-02-09T14:20:36.000Z","published_at":"2015-02-02T05:25:36.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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 returns that number of rows in a vector or matrix 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\u003eexample: x = [1; 2; 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\u003eoutput = 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":2991,"title":"Finding an element in a vector","description":"x is a vector of unknown length\r\n\r\nyour function should return the index of the first element in the vector that is greater than 6. If all elements in x are less than 6, the function should return 'none'\r\n\r\nexample: x = [1 2 7 2 3 2 4 8 6]\r\n\r\noutput = 3","description_html":"\u003cp\u003ex is a vector of unknown length\u003c/p\u003e\u003cp\u003eyour function should return the index of the first element in the vector that is greater than 6. If all elements in x are less than 6, the function should return 'none'\u003c/p\u003e\u003cp\u003eexample: x = [1 2 7 2 3 2 4 8 6]\u003c/p\u003e\u003cp\u003eoutput = 3\u003c/p\u003e","function_template":"function ind = first_six(x)\r\n  \r\nend","test_suite":"%%\r\nx = [1 2 7 2 3 2 4 8 6];\r\ny_correct = 3;\r\nassert(isequal(first_six(x),y_correct))\r\n%%\r\nx = [2 1 4 1 2 10 9 4 12 1 6 5 10 10 3 6 6 8 9 10];\r\ny_correct = 6;\r\nassert(isequal(first_six(x),y_correct))\r\n%%\r\nx = [4 2 3 4 5 5 3 1 1 2];\r\ny_correct = 'none';\r\nassert(isequal(first_six(x),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":204,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-09T23:35:55.000Z","updated_at":"2026-03-28T01:30:09.000Z","published_at":"2015-02-09T23:35: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\",\"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 a vector of unknown length\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\u003eyour function should return the index of the first element in the vector that is greater than 6. If all elements in x are less than 6, the function should return 'none'\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: x = [1 2 7 2 3 2 4 8 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\u003eoutput = 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":2917,"title":"Matlab Basics II - Intervals","description":"Write a function that takes an interval from a to b, and divides it into 5 parts\r\n\r\nexample:\r\n\r\na = 1, b = 2\r\n\r\noutput = 1 1.25 1.5 1.75 2","description_html":"\u003cp\u003eWrite a function that takes an interval from a to b, and divides it into 5 parts\u003c/p\u003e\u003cp\u003eexample:\u003c/p\u003e\u003cp\u003ea = 1, b = 2\u003c/p\u003e\u003cp\u003eoutput = 1 1.25 1.5 1.75 2\u003c/p\u003e","function_template":"function y = split_to_five(a,b)\r\n  y = ;\r\nend","test_suite":"%%\r\na = 1; b=2;\r\ny_correct = [1 1.25 1.5 1.75 2];\r\nassert(isequal(split_to_five(a,b),y_correct))\r\n\r\n%%\r\na = 20; b=30;\r\ny_correct = [20 22.5 25 27.5 30];\r\nassert(isequal(split_to_five(a,b),y_correct))\r\n\r\n%%\r\na = 30; b=-20;\r\ny_correct = [30 17.5 5 -7.5 -20];\r\nassert(isequal(split_to_five(a,b),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":328,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T22:18:24.000Z","updated_at":"2026-03-29T20:39:32.000Z","published_at":"2015-02-02T05:26:49.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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 an interval from a to b, and divides it into 5 parts\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\u003ea = 1, b = 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\u003eoutput = 1 1.25 1.5 1.75 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":2863,"title":"Matlab Basics - Set unwanted parts of a vector to zero","description":"Consider a vector x, of length \u003e= 7, write a script to set elements 2, 5, and 6 to zero.\r\n\r\nExample\r\n\r\n x = [1 2 3 4 5 6 7] --\u003e x = [1 0 3 4 0 0 7]","description_html":"\u003cp\u003eConsider a vector x, of length \u0026gt;= 7, write a script to set elements 2, 5, and 6 to zero.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e x = [1 2 3 4 5 6 7] --\u0026gt; x = [1 0 3 4 0 0 7]\u003c/pre\u003e","function_template":"function x = set_2_5_6_to_zero(x)\r\n  \r\nend","test_suite":"%%\r\nx = [1 2 3 4 5 6 7];\r\nx_cor = [1 0 3 4 0 0 7];\r\nassert(isequal(set_2_5_6_to_zero(x),x_cor))\r\n%%\r\nx = [3 5 7 2 8 9 12 22 13 17 6];\r\nx_cor = [3 0 7 2 0 0 12 22 13 17 6];\r\nassert(isequal(set_2_5_6_to_zero(x),x_cor))%%\r\nx = [12.2 16.5 13.2 2.5 9.7 7.6 3.1 1.4];\r\nx_cor = [12.2 0 13.2 2.5 0 0 3.1 1.4];\r\nassert(isequal(set_2_5_6_to_zero(x),x_cor))","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":261,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:02:53.000Z","updated_at":"2026-02-12T15:30:57.000Z","published_at":"2015-01-22T19:29:30.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConsider a vector x, of length \u0026gt;= 7, write a script to set elements 2, 5, and 6 to zero.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x = [1 2 3 4 5 6 7] --\u003e x = [1 0 3 4 0 0 7]]]\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":2868,"title":"Matlab Basics - y as a function of x","description":"Write a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2","description_html":"\u003cp\u003eWrite a function to calculate y as a function of x, such that y = 6x^2 + 5x - 2\u003c/p\u003e","function_template":"function y = y_fun_1(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 9;\r\nassert(isequal(y_fun_1(x),y_correct))\r\n%%\r\nx = 3;\r\ny_correct = 67;\r\nassert(isequal(y_fun_1(x),y_correct))\r\n%%\r\nx = 3.2;\r\ny_correct = 75.440000000000010;\r\nassert(isequal(y_fun_1(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":527,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:20:52.000Z","updated_at":"2026-03-28T01:23:21.000Z","published_at":"2015-01-22T19:26:05.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 calculate y as a function of x, such that y = 6x^2 + 5x - 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":2911,"title":"Matlab Basics II - squares","description":"Write a function that takes matrix A, and squares each element in the matrix\r\n\r\nexample:\r\nA = [1 2 3]\r\n\r\noutput = [1 4 9]","description_html":"\u003cp\u003eWrite a function that takes matrix A, and squares each element in the matrix\u003c/p\u003e\u003cp\u003eexample:\r\nA = [1 2 3]\u003c/p\u003e\u003cp\u003eoutput = [1 4 9]\u003c/p\u003e","function_template":"function y = square_elements(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [1 2 3];\r\ny_correct = [1 4 9];\r\nassert(isequal(square_elements(x),y_correct))\r\n\r\n%%\r\nx = [33 44 5; 56 20 12];\r\ny_correct = [1089 1936 25;3136 400 144];\r\nassert(isequal(square_elements(x),y_correct))\r\n\r\n%%\r\nx=[3.3 4.4 5; 5.6 2.0 1.2];\r\ny_correct = [10.889999999999999 19.360000000000003 25; 31.359999999999996 4 1.440000000000000];\r\nassert(isequal(square_elements(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":480,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T20:38:40.000Z","updated_at":"2026-02-09T14:25:55.000Z","published_at":"2015-02-02T05:24: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\",\"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 matrix A, and squares each element in the 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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eexample: A = [1 2 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\u003eoutput = [1 4 9]\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":2858,"title":"Matlab Basics - Logical Tests I","description":"Write a script to test whether a year number is for a leap year or not.\r\n\r\neg. x = 1884\r\noutput = 1\r\n\r\neg. x = 3\r\noutput = 0","description_html":"\u003cp\u003eWrite a script to test whether a year number is for a leap year or not.\u003c/p\u003e\u003cp\u003eeg. x = 1884\r\noutput = 1\u003c/p\u003e\u003cp\u003eeg. x = 3\r\noutput = 0\u003c/p\u003e","function_template":"function y = leap(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1884;\r\ny = 1;\r\nassert(isequal(leap(x),y))\r\n%%\r\nx = 3;\r\ny = 0;\r\nassert(isequal(leap(x),y))\r\n%%\r\nx = 522;\r\ny = 0;\r\nassert(isequal(leap(x),y))\r\n\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":270,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-20T19:35:57.000Z","updated_at":"2026-02-16T12:13:28.000Z","published_at":"2015-01-22T19:33:44.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 test whether a year number is for a leap year or not.\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. x = 1884 output = 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\u003eeg. x = 3 output = 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":2904,"title":"Matlab Basics II - 3 Dimensional Arrays","description":"Assume x is a 3D array with n pages, representing students in a class, for each student (page in the array, the 3rd dimension), their grades are reported in two columns: Total Grade \u0026 Percent Grade. The rows of the student's page represent Math, Physics, Chemistry, and Biology in that order.\r\n\r\nWrite a function that extracts a student's Percent Grade in Physics given the student's number (n)","description_html":"\u003cp\u003eAssume x is a 3D array with n pages, representing students in a class, for each student (page in the array, the 3rd dimension), their grades are reported in two columns: Total Grade \u0026 Percent Grade. The rows of the student's page represent Math, Physics, Chemistry, and Biology in that order.\u003c/p\u003e\u003cp\u003eWrite a function that extracts a student's Percent Grade in Physics given the student's number (n)\u003c/p\u003e","function_template":"function y = phy_grade(x,n)\r\n  y = ;\r\nend","test_suite":"%%\r\nx(:,:,3) = [48,96;40,80;42,84;45,90];\r\nx(:,:,2) = [42,84;36,72;40,80;42,84];\r\nn = 2\r\ny_correct = 72;\r\nassert(isequal(phy_grade(x,n),y_correct))\r\n\r\n%%\r\nx(:,:,3) = [3,6;32,64;42,84;45,90];\r\nn = 3\r\ny_correct = 64;\r\nassert(isequal(phy_grade(x,n),y_correct))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":34237,"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-01-30T22:10:33.000Z","updated_at":"2026-02-17T09:12:47.000Z","published_at":"2015-02-02T05:23:54.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eAssume x is a 3D array with n pages, representing students in a class, for each student (page in the array, the 3rd dimension), their grades are reported in two columns: Total Grade \u0026amp; Percent Grade. The rows of the student's page represent Math, Physics, Chemistry, and Biology in that order.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that extracts a student's Percent Grade in Physics given the student's number (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":2990,"title":"Replace every 3rd element in a vector with 4","description":"x is a vector of undetermined length\r\n\r\nYou are to replace every 3rd element with the number 4, example:\r\n\r\nx = [11 23 34 43 2 31 6 34 5 45 26 7 78];\r\n\r\noutput = [11 23 *4* 43 2 *4* 6 34 *4* 45 26 *4* 78];\r\n\r\nMake sure the code accounts for varying vector lengths","description_html":"\u003cp\u003ex is a vector of undetermined length\u003c/p\u003e\u003cp\u003eYou are to replace every 3rd element with the number 4, example:\u003c/p\u003e\u003cp\u003ex = [11 23 34 43 2 31 6 34 5 45 26 7 78];\u003c/p\u003e\u003cp\u003eoutput = [11 23 \u003cb\u003e4\u003c/b\u003e 43 2 \u003cb\u003e4\u003c/b\u003e 6 34 \u003cb\u003e4\u003c/b\u003e 45 26 \u003cb\u003e4\u003c/b\u003e 78];\u003c/p\u003e\u003cp\u003eMake sure the code accounts for varying vector lengths\u003c/p\u003e","function_template":"function x = every_3rd_element(x)\r\n  \r\nend","test_suite":"%%\r\nx = [11 23 34 43 2 31 6 34 5 45 26 7 78];\r\ny_correct = [11 23 4 43 2 4 6 34 4 45 26 4 78];\r\nassert(isequal(every_3rd_element(x),y_correct))\r\n\r\n%%\r\nx = [82\t91 13 92 64 10 28 55 96 97 16 98 96 49 81 15 43 92 80 96 66 4 85 94 68 76 75 40 66 18];\r\ny_correct = [82\t91 4 92 64 4 28 55 4 97 16 4 96 49 4 15 43 4 80 96 4 4 85 4 68 76 4 40 66 4];\r\nassert(isequal(every_3rd_element(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":265,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-09T23:16:18.000Z","updated_at":"2026-02-17T14:29:02.000Z","published_at":"2015-02-09T23:16:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003ex is a vector of undetermined length\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\u003eYou are to replace every 3rd element with the number 4, example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex = [11 23 34 43 2 31 6 34 5 45 26 7 78];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput = [11 23\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\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 43 2\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\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 6 34\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\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 45 26\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\u003e4\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e 78];\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\u003eMake sure the code accounts for varying vector lengths\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":2856,"title":"Matlab Basics - Create a row vector","description":"Write a Matlab script to create a row vector of 10 consecutive numbers\r\nx = [1 2 3 4 5 6 7 8 9 10]","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 408px 25.5px; transform-origin: 408px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a Matlab script to create a row vector of 10 consecutive numbers\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ex = [1 2 3 4 5 6 7 8 9 10]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function x = create_row()\r\n  x = 1:10;\r\nend","test_suite":"%%\r\nassert(isequal(diff(create_row) ,ones(1,9)))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":8,"created_by":34237,"edited_by":3348724,"edited_at":"2025-12-19T21:22:30.000Z","deleted_by":null,"deleted_at":null,"solvers_count":317,"test_suite_updated_at":"2025-12-19T21:22:30.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-20T19:21:30.000Z","updated_at":"2026-03-31T09:56:09.000Z","published_at":"2015-01-22T19:35:13.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\u003eWrite a Matlab script to create a row vector of 10 consecutive numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex = [1 2 3 4 5 6 7 8 9 10]\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":2927,"title":"Matlab Basics II - Max \u0026 Index of Max","description":"Write a function that takes a vector x, then returns both the max value in x and its location in the vector\r\n\r\nfor example\r\n\r\nx = [1 4 5 2 3]\r\n\r\noutput: [5,3]","description_html":"\u003cp\u003eWrite a function that takes a vector x, then returns both the max value in x and its location in the vector\u003c/p\u003e\u003cp\u003efor example\u003c/p\u003e\u003cp\u003ex = [1 4 5 2 3]\u003c/p\u003e\u003cp\u003eoutput: [5,3]\u003c/p\u003e","function_template":"function out = max_ind_max(x)\r\n  \r\nend","test_suite":"%%\r\nx = [1 4 5 2 3];\r\ny_correct = [5,3];\r\nassert(isequal(max_ind_max(x),y_correct))\r\n\r\n%%\r\nx = [3.2 4.3 -9.8 4.7 -10.9 3.7 -2.5];\r\ny_correct = [4.7,4];\r\nassert(isequal(max_ind_max(x),y_correct))","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":266,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-02T03:52:25.000Z","updated_at":"2026-03-28T01:25:44.000Z","published_at":"2015-02-02T05:29: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\u003eWrite a function that takes a vector x, then returns both the max value in x and its location in the vector\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\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 4 5 2 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\u003eoutput: [5,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":2916,"title":"Matlab Basics II - Log and natural log","description":"Write a function that calculates the difference between the log and natural log of a vector, to two decimal places\r\n\r\nexample:\r\n\r\nx = [10, 100, 1000]\r\n\r\noutput = [1.3 2.61 3.91]","description_html":"\u003cp\u003eWrite a function that calculates the difference between the log and natural log of a vector, to two decimal places\u003c/p\u003e\u003cp\u003eexample:\u003c/p\u003e\u003cp\u003ex = [10, 100, 1000]\u003c/p\u003e\u003cp\u003eoutput = [1.3 2.61 3.91]\u003c/p\u003e","function_template":"function y = logarithms(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = [10 100 1000];\r\ny_correct = [1.30 2.61 3.91];\r\nassert(isequal(logarithms(x),y_correct))\r\n\r\n%%\r\nx = [50 1.2 4567; 200 67 820];;\r\ny_correct = [2.21 0.10 4.77; 3 2.38 3.8];\r\nassert(isequal(logarithms(x),y_correct))\r\n\r\n%%\r\nx = [0.5 1.2 4.5; 23 33 3.3];\r\ny_correct = [-0.39 0.1 0.85; 1.77 1.98 0.68];\r\nassert(isequal(logarithms(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":193,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T22:14:43.000Z","updated_at":"2026-03-02T15:20:04.000Z","published_at":"2015-02-02T05:26:28.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 calculates the difference between the log and natural log of a vector, to two decimal places\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 = [10, 100, 1000]\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 = [1.3 2.61 3.91]\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":2849,"title":"Matlab Basics - Assigning Variables","description":"Assign different types of data to variables: integer, double, and strings\r\n\r\nExample:\r\nA is a double, for example 2.34\r\n\r\nB is an integer, for example 17\r\n\r\nC is a string, for example \"hello\"","description_html":"\u003cp\u003eAssign different types of data to variables: integer, double, and strings\u003c/p\u003e\u003cp\u003eExample:\r\nA is a double, for example 2.34\u003c/p\u003e\u003cp\u003eB is an integer, for example 17\u003c/p\u003e\u003cp\u003eC is a string, for example \"hello\"\u003c/p\u003e","function_template":"function y = \r\n  A = ;\r\n  B = ;\r\n  C = ;\r\nend","test_suite":"%%\r\nA = 2.34;\r\nassert(isequal(class(A),'double'))\r\n%%\r\nB = int64(17);\r\nassert(isequal(class(B),'int8')||isequal(class(B),'int16')||isequal(class(B),'int32')||isequal(class(B),'int64'))\r\n%%\r\nC = 'hello';\r\nassert(isequal(class(C),'char'))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":34237,"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":"2015-01-19T19:38:17.000Z","updated_at":"2026-03-04T15:45:43.000Z","published_at":"2015-01-22T19:24: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\u003eAssign different types of data to variables: integer, double, and strings\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: A is a double, for example 2.34\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\u003eB is an integer, for example 17\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\u003eC is a string, for example \\\"hello\\\"\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":2925,"title":"Matlab Basics II - Create a vector with a repeated entry","description":"Create a row vector of length n, filled with 4's, for example, if n = 3\r\n\r\noutput = [4 4 4]\r\n\r\nmake sure to round UP when n is a decimal, and take the absolute value when n is negative","description_html":"\u003cp\u003eCreate a row vector of length n, filled with 4's, for example, if n = 3\u003c/p\u003e\u003cp\u003eoutput = [4 4 4]\u003c/p\u003e\u003cp\u003emake sure to round UP when n is a decimal, and take the absolute value when n is negative\u003c/p\u003e","function_template":"function y = fours(n)\r\n  y = \r\nend","test_suite":"%%\r\nn = 3;\r\ny_correct = [4 4 4];\r\nassert(isequal(fours(n),y_correct))\r\n\r\n%%\r\nn = 5.5;\r\ny_correct = [4 4 4 4 4 4];\r\nassert(isequal(fours(n),y_correct))\r\n\r\n%%\r\nn = 7;\r\ny_correct = [4 4 4 4 4 4 4];\r\nassert(isequal(fours(n),y_correct))\r\n\r\n%%\r\nn = -2;\r\ny_correct = [4 4];\r\nassert(isequal(fours(n),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":252,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-02T03:41:00.000Z","updated_at":"2026-02-18T11:02:49.000Z","published_at":"2015-02-02T05:29:08.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate a row vector of length n, filled with 4's, for example, if n = 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\u003eoutput = [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\u003emake sure to round UP when n is a decimal, and take the absolute value when n is negative\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":2926,"title":"Matlab Basics II - Minimum","description":"Write a function that returns the minimum of each ROW of a matrix x\r\n\r\nexample: x = [1 2 3; 4 5 6];\r\n\r\noutput [1;4];","description_html":"\u003cp\u003eWrite a function that returns the minimum of each ROW of a matrix x\u003c/p\u003e\u003cp\u003eexample: x = [1 2 3; 4 5 6];\u003c/p\u003e\u003cp\u003eoutput [1;4];\u003c/p\u003e","function_template":"function y = min_per_row(x)\r\n  y = \r\nend","test_suite":"%%\r\nx = [1 2 3;4 5 6];\r\ny_correct = [1;4];\r\nassert(isequal(min_per_row(x),y_correct))\r\n\r\n%%\r\nx = [7.2 -2.5 5.1;4.2 -9.8 3.6];\r\ny_correct = [-2.5;-9.8];\r\nassert(isequal(min_per_row(x),y_correct))\r\n\r\n%%\r\nx = [pi exp(1) pi/2;3 pi 4];\r\ny_correct = [pi/2;3];\r\nassert(isequal(min_per_row(x),y_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":398,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-02T03:47:26.000Z","updated_at":"2026-02-18T14:58:00.000Z","published_at":"2015-02-02T05:29: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\u003eWrite a function that returns the minimum of each ROW of a matrix 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\u003eexample: x = [1 2 3; 4 5 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\u003eoutput [1;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":2915,"title":"Matlab Basics II - Find the roots of a function","description":"Write a function that finds where a curve crosses zero (the x-axis) to two decimal places\r\n\r\nExample: \r\n\r\n\u003c\u003chttp://s14.postimg.org/vibfltgyl/cody2.png\u003e\u003e\r\n\r\noutput:\r\n\r\n   [0 ; 1.13 ;  -0.53]","description_html":"\u003cp\u003eWrite a function that finds where a curve crosses zero (the x-axis) to two decimal places\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cimg src = \"http://s14.postimg.org/vibfltgyl/cody2.png\"\u003e\u003cp\u003eoutput:\u003c/p\u003e\u003cpre\u003e   [0 ; 1.13 ;  -0.53]\u003c/pre\u003e","function_template":"function y = cross_zero(x)\r\n  y = \r\n\r\nend","test_suite":"%%\r\nx = [5 -3 -3 0];\r\ny_correct = [0;1.13;-0.53];\r\nassert(isequal(cross_zero(x),y_correct))\r\n\r\n%%\r\nx = [1 2 3 4 5];\r\ny_correct = [0.29 + 1.42i; 0.29 - 1.42i; -1.29 + 0.86i; -1.29 - 0.86i];\r\nassert(isequal(cross_zero(x),y_correct))\r\n\r\n%%\r\nx = [2 5 0 -4 0];\r\ny_correct = [0; -2; -1.28; 0.78];\r\nassert(isequal(cross_zero(x),y_correct))","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":92,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T22:01:50.000Z","updated_at":"2026-02-12T18:18:15.000Z","published_at":"2015-02-02T05:26:07.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\u003eWrite a function that finds where a curve crosses zero (the x-axis) to two decimal places\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: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\u003eoutput:\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[   [0 ; 1.13 ;  -0.53]]]\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,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEV4eHiTk5P29vaBgYGcnJzAwMC3t7eKiorS0tLt7e3b29vk5OTJycn///9vb28AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD61b95AAAAyklEQVR42q2SSQ6FIAxAWzQxkcj976lEE5R+hojQOmw+Cxa8RwcoGnhf6oNDD0AvGL8j/E2wC+JiXwSaAKbbatGkLjBrX13szynmtPXnKc2eCRiMGQtXxrq2hmZRuuXx6SVdPlPpopeC387sFMMIwdsyAMFAEcHuptW5oIaKYgjHBBoZ512snMeJ8g7o0DmA5jwKXRdqy9W6gfMzhd7iMOySlxq0qn/z4leR43HNQ8WrLtYi1Dz+pnjsmt/8ZsulwLgQOOeC4EyQHH5z1GUZiLNTtwAAAABJRU5ErkJggg==\"}]}"},{"id":2913,"title":"Matlab Basics II - Velocity of a particle","description":"A particle is moving in space, such that it's velocity is given by:\r\n\r\n\u003c\u003chttp://s30.postimg.org/5rf1xtvj5/cody1.png\u003e\u003e\r\n\r\nwrite a function that calculates velocity based on position (x) and time(t)","description_html":"\u003cp\u003eA particle is moving in space, such that it's velocity is given by:\u003c/p\u003e\u003cimg src = \"http://s30.postimg.org/5rf1xtvj5/cody1.png\"\u003e\u003cp\u003ewrite a function that calculates velocity based on position (x) and time(t)\u003c/p\u003e","function_template":"function v = particle_vel(x,t)\r\n  v = \r\nend","test_suite":"%%\r\nx = 2.1;\r\nt = 4.2;\r\nv_correct = 23.849128073359125;\r\nassert(isequal(particle_vel(x,t),v_correct))\r\n\r\n%%\r\nx = -5.3;\r\nt = 6.8;\r\nv_correct = -22.273808521444963;\r\nassert(isequal(particle_vel(x,t),v_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":7,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":154,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-01T21:03:37.000Z","updated_at":"2026-02-12T18:13:23.000Z","published_at":"2015-02-02T05:25:09.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eA particle is moving in space, such that it's velocity is 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\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\u003ewrite a function that calculates velocity based on position (x) and time(t)\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,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEV4eHiTk5P29vaBgYGcnJzAwMC3t7eKiorS0tLt7e3b29vk5OTJycn///9vb28AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD61b95AAAAyklEQVR42q2SSQ6FIAxAWzQxkcj976lEE5R+hojQOmw+Cxa8RwcoGnhf6oNDD0AvGL8j/E2wC+JiXwSaAKbbatGkLjBrX13szynmtPXnKc2eCRiMGQtXxrq2hmZRuuXx6SVdPlPpopeC387sFMMIwdsyAMFAEcHuptW5oIaKYgjHBBoZ512snMeJ8g7o0DmA5jwKXRdqy9W6gfMzhd7iMOySlxq0qn/z4leR43HNQ8WrLtYi1Dz+pnjsmt/8ZsulwLgQOOeC4EyQHH5z1GUZiLNTtwAAAABJRU5ErkJggg==\"}]}"},{"id":2866,"title":"Matlab Basics - Rounding II","description":"Write a script to round a variable x to 3 decimal places:\r\n\r\ne.g. x = 2.3456 --\u003e y = 2.346","description_html":"\u003cp\u003eWrite a script to round a variable x to 3 decimal places:\u003c/p\u003e\u003cp\u003ee.g. x = 2.3456 --\u0026gt; y = 2.346\u003c/p\u003e","function_template":"function y = round_3_d_p(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1.000;\r\nassert(isequal(round_3_d_p(x),y_correct))\r\n%%\r\nx = 2.3456;\r\ny_correct = 2.346;\r\nassert(isequal(round_3_d_p(x),y_correct))\r\n%%\r\nx = 16.2683254;\r\ny_correct = 16.268;\r\nassert(isequal(round_3_d_p(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":24,"comments_count":3,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5635,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:15:01.000Z","updated_at":"2026-04-01T21:36:22.000Z","published_at":"2015-01-22T19:28: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\u003eWrite a script to round a variable x to 3 decimal places:\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 = 2.3456 --\u0026gt; y = 2.346\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":2850,"title":"Matlab Basics - Switching Assignments","description":"Switch assignments for variables x and y, for example\r\n\r\nstart with x = 1 and y = 3\r\nend with y = 1 and x = 3\r\n\r\nDo NOT simply re-assign variables, use a temporary variable 'z'","description_html":"\u003cp\u003eSwitch assignments for variables x and y, for example\u003c/p\u003e\u003cp\u003estart with x = 1 and y = 3\r\nend with y = 1 and x = 3\u003c/p\u003e\u003cp\u003eDo NOT simply re-assign variables, use a temporary variable 'z'\u003c/p\u003e","function_template":"function [x,y] = swap_vars(x,y)\r\n  z = ;\r\nend","test_suite":"%%\r\n[x,y] = swap_vars(5,10);\r\nassert(isequal(x,10));\r\nassert(isequal(y,5));\r\n%%\r\n[x,y] = swap_vars('hello','bye');\r\nassert(isequal(x,'bye'));\r\nassert(isequal(y,'hello'));\r\n%%\r\n[x,y] = swap_vars(5,'hello');\r\nassert(isequal(x,'hello'));\r\nassert(isequal(y,5));","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":505,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-19T19:54:02.000Z","updated_at":"2026-02-14T13:02:40.000Z","published_at":"2015-01-22T19:24:28.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\u003eSwitch assignments for variables x and y, 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\u003estart with x = 1 and y = 3 end with y = 1 and x = 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\u003eDo NOT simply re-assign variables, use a temporary variable 'z'\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":2867,"title":"Matlab Basics - Rounding III","description":"Write a script to round a large number to the nearest 10,000\r\n\r\ne.g. x = 12,358,466,243 --\u003e y = 12,358,470,000","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 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: 190px 8px; transform-origin: 190px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a script to round a large number to the nearest 10,000\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: 149.5px 8px; transform-origin: 149.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ee.g. x = 12,358,466,243 --\u0026gt; y = 12,358,470,000\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = round_ten_thou(x)\r\n  y = ;\r\nend","test_suite":"%%\r\nx = 12358466243;\r\ny_correct = 12358470000;\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = -1235846.325;\r\ny_correct = -1240000;\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = 1266243.325;\r\ny_correct = 1270000;\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = 987654321;\r\ny_correct = 987650000;\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = [1:4999];\r\ny_correct = zeros(1,4999);\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = [];\r\nassert(isempty(round_ten_thou(x)))\r\n%%\r\nx = [-5001:-1:-6000];\r\ny_correct = -1e4*ones(1,1e3);\r\nassert(isequal(round_ten_thou(x),y_correct))\r\n%%\r\nx = -54321.67890;\r\ny_correct = -5e4;\r\nassert(isequal(round_ten_thou(x),y_correct))","published":true,"deleted":false,"likes_count":29,"comments_count":7,"created_by":34237,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5179,"test_suite_updated_at":"2021-05-09T15:34:34.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-01-21T17:19:47.000Z","updated_at":"2026-04-01T21:37:46.000Z","published_at":"2015-01-22T19:27:53.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\u003eWrite a script to round a large number to the nearest 10,000\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 = 12,358,466,243 --\u0026gt; y = 12,358,470,000\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\"}]}"}],"term":"tag:\"uic-bioe 240\"","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:\"uic-bioe 240\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"uic-bioe 240\"","","\"","uic-bioe 240","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f1943b0a780\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f1943b0a6e0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f1943b09e20\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f1943b0aa00\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f1943b0a960\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f1943b0a8c0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f1943b0a820\u003e":"tag:\"uic-bioe 240\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f1943b0a820\u003e":"tag:\"uic-bioe 240\""},"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:\"uic-bioe 240\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"uic-bioe 240\"","","\"","uic-bioe 240","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f1943b0a780\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f1943b0a6e0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f1943b09e20\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f1943b0aa00\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f1943b0a960\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f1943b0a8c0\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f1943b0a820\u003e":"tag:\"uic-bioe 240\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f1943b0a820\u003e":"tag:\"uic-bioe 240\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":2880,"difficulty_rating":"easy"},{"id":2924,"difficulty_rating":"easy"},{"id":2862,"difficulty_rating":"easy"},{"id":2864,"difficulty_rating":"easy"},{"id":2912,"difficulty_rating":"easy"},{"id":2857,"difficulty_rating":"easy"},{"id":2865,"difficulty_rating":"easy"},{"id":2918,"difficulty_rating":"easy"},{"id":2550,"difficulty_rating":"easy"},{"id":2549,"difficulty_rating":"easy"},{"id":2914,"difficulty_rating":"easy"},{"id":2991,"difficulty_rating":"easy"},{"id":2917,"difficulty_rating":"easy"},{"id":2863,"difficulty_rating":"easy"},{"id":2868,"difficulty_rating":"easy"},{"id":2911,"difficulty_rating":"easy"},{"id":2858,"difficulty_rating":"easy"},{"id":2904,"difficulty_rating":"easy"},{"id":2990,"difficulty_rating":"easy"},{"id":2856,"difficulty_rating":"easy"},{"id":2927,"difficulty_rating":"easy"},{"id":2916,"difficulty_rating":"easy"},{"id":2849,"difficulty_rating":"easy"},{"id":2925,"difficulty_rating":"easy"},{"id":2926,"difficulty_rating":"easy"},{"id":2915,"difficulty_rating":"easy"},{"id":2913,"difficulty_rating":"easy"},{"id":2866,"difficulty_rating":"easy-medium"},{"id":2850,"difficulty_rating":"easy-medium"},{"id":2867,"difficulty_rating":"easy-medium"}]}}