{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-26T00:14:02.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-04-26T00: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":44405,"title":"Back to basics:  adding comments to your code","description":"One of the most useful skills a programmer can develop is the skill — or habit — of writing descriptive comments within/above the code that they work on.  \r\n\r\nTop reasons for including comments in one's code:\r\n\r\n# Helpful while you are initially developing the code.\r\n# Helpful if you are collaborating on the development, so others need to be able to use/amend/revise it.  \r\n# Helpful if you need to revisit the code later on (could be months or years later), such as to extend it or amend it.  \r\n# Helpful if someone else may work on the code in future, such as to extend it or amend it. \r\n# *Helpful on Cody for other players who can learn from inspecting your code.*\r\n\r\nMATLAB provides _three_ main methods of adding \u003chttps://au.mathworks.com/help/matlab/matlab_prog/comments.html comments\u003e to your code:\r\n\r\n* comments;\r\n* comments also serving as 'code section' delimiters \u0026 titles (these may be more appropriate in \u003chttps://au.mathworks.com/help/matlab/scripts.html scripts\u003e  than within \u003chttps://au.mathworks.com/help/matlab/functions.html functions\u003e, but it is still possible to practice using them here);\r\n* block comments.  \r\n\r\n_Note:  some other features of MATLAB that are related to comments are illustrated at the top of the Test Suite, but are outside the present scope. Specifically, ellipsis (...) is deemed here a technique primarily for line continuation, not primarily for adding descriptions to the code._\r\n \r\n*Your PRIMARY task is to utilize _all three_ comment styles in your submission.*  Your comments will have to be of 'meaningful' length (i.e. not so short as to have no clear meaning).\r\n\r\nHowever, to make it slightly more interesting — and to have something specific to comment upon — as a *SECONDARY task* you will also have to solve the equation \r\n\r\n*√(x³ − 3/2) = A*\r\n\r\nfor x (find x), in which A is a constant that will be provided as an input.  \"√\" represents the square-root radical sign.  Note that generally x will _not_ be an integer.  \r\n\r\nMoreover, your result should be returned _rounded_ (in the usual way) to the _minimum_ number of decimal places so that the left-hand side of the equation will be within the span defined by  *A ± 0.0001*.  \r\n\r\nEXAMPLE\r\n\r\n  A = 8\r\n  x = 4.031\r\n\r\nThe exact value of x is more accurately approximated as 4.031008989457290.  However, this is more than the minimum required precision.  \r\nBy setting x = 4.031, the left-hand side of the equation yields 7.999973, which is only 0.000027 less than the target value of A, and therefore acceptable.  \r\nNote that more aggressive rounding of x to x = 4.03 would yield an unacceptably poor estimate for A, namely 7.996926 (an error of 0.003074).  See also the table below:\r\n\r\n x\t        √(x³ − 3/2)\tA  \tError   \tError size\r\n 4.0310089895\t8.00000000013\t8\t+1.3E-10\tOK\r\n 4.031008990 \t8.00000000165\t8\t+1.7E-09\tOK\r\n 4.03100899  \t8.00000000165\t8\t+1.7E-09\tOK\r\n 4.0310090   \t8.00000003212\t8\t+3.2E-08\tOK\r\n 4.031009    \t8.00000003212\t8\t+3.2E-08\tOK\r\n 4.03101     \t8.00000307881\t8\t+3.1E-06\tOK\r\n 4.0310      \t7.99997261189\t8\t-2.7E-05\tOK\r\n 4.031       \t7.99997261189\t8\t-2.7E-05\tOK\t\u003c—— Most rounding yielding \"OK\"\r\n 4.03        \t7.99692609695\t8\t-3.1E-03\tToo big\r\n 4.0         \t7.90569415042\t8\t-9.4E-02\tToo big\r\n 4.          \t7.90569415042\t8\t-9.4E-02\tToo big","description_html":"\u003cp\u003eOne of the most useful skills a programmer can develop is the skill — or habit — of writing descriptive comments within/above the code that they work on.\u003c/p\u003e\u003cp\u003eTop reasons for including comments in one's code:\u003c/p\u003e\u003col\u003e\u003cli\u003eHelpful while you are initially developing the code.\u003c/li\u003e\u003cli\u003eHelpful if you are collaborating on the development, so others need to be able to use/amend/revise it.\u003c/li\u003e\u003cli\u003eHelpful if you need to revisit the code later on (could be months or years later), such as to extend it or amend it.\u003c/li\u003e\u003cli\u003eHelpful if someone else may work on the code in future, such as to extend it or amend it.\u003c/li\u003e\u003cli\u003e\u003cb\u003eHelpful on Cody for other players who can learn from inspecting your code.\u003c/b\u003e\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eMATLAB provides \u003ci\u003ethree\u003c/i\u003e main methods of adding \u003ca href = \"https://au.mathworks.com/help/matlab/matlab_prog/comments.html\"\u003ecomments\u003c/a\u003e to your code:\u003c/p\u003e\u003cul\u003e\u003cli\u003ecomments;\u003c/li\u003e\u003cli\u003ecomments also serving as 'code section' delimiters \u0026 titles (these may be more appropriate in \u003ca href = \"https://au.mathworks.com/help/matlab/scripts.html\"\u003escripts\u003c/a\u003e  than within \u003ca href = \"https://au.mathworks.com/help/matlab/functions.html\"\u003efunctions\u003c/a\u003e, but it is still possible to practice using them here);\u003c/li\u003e\u003cli\u003eblock comments.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003ci\u003eNote:  some other features of MATLAB that are related to comments are illustrated at the top of the Test Suite, but are outside the present scope. Specifically, ellipsis (...) is deemed here a technique primarily for line continuation, not primarily for adding descriptions to the code.\u003c/i\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eYour PRIMARY task is to utilize \u003ci\u003eall three\u003c/i\u003e comment styles in your submission.\u003c/b\u003e  Your comments will have to be of 'meaningful' length (i.e. not so short as to have no clear meaning).\u003c/p\u003e\u003cp\u003eHowever, to make it slightly more interesting — and to have something specific to comment upon — as a \u003cb\u003eSECONDARY task\u003c/b\u003e you will also have to solve the equation\u003c/p\u003e\u003cp\u003e\u003cb\u003e√(x³ − 3/2) = A\u003c/b\u003e\u003c/p\u003e\u003cp\u003efor x (find x), in which A is a constant that will be provided as an input.  \"√\" represents the square-root radical sign.  Note that generally x will \u003ci\u003enot\u003c/i\u003e be an integer.\u003c/p\u003e\u003cp\u003eMoreover, your result should be returned \u003ci\u003erounded\u003c/i\u003e (in the usual way) to the \u003ci\u003eminimum\u003c/i\u003e number of decimal places so that the left-hand side of the equation will be within the span defined by  \u003cb\u003eA ± 0.0001\u003c/b\u003e.\u003c/p\u003e\u003cp\u003eEXAMPLE\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = 8\r\nx = 4.031\r\n\u003c/pre\u003e\u003cp\u003eThe exact value of x is more accurately approximated as 4.031008989457290.  However, this is more than the minimum required precision.  \r\nBy setting x = 4.031, the left-hand side of the equation yields 7.999973, which is only 0.000027 less than the target value of A, and therefore acceptable.  \r\nNote that more aggressive rounding of x to x = 4.03 would yield an unacceptably poor estimate for A, namely 7.996926 (an error of 0.003074).  See also the table below:\u003c/p\u003e\u003cpre\u003e x\t        √(x³ − 3/2)\tA  \tError   \tError size\r\n 4.0310089895\t8.00000000013\t8\t+1.3E-10\tOK\r\n 4.031008990 \t8.00000000165\t8\t+1.7E-09\tOK\r\n 4.03100899  \t8.00000000165\t8\t+1.7E-09\tOK\r\n 4.0310090   \t8.00000003212\t8\t+3.2E-08\tOK\r\n 4.031009    \t8.00000003212\t8\t+3.2E-08\tOK\r\n 4.03101     \t8.00000307881\t8\t+3.1E-06\tOK\r\n 4.0310      \t7.99997261189\t8\t-2.7E-05\tOK\r\n 4.031       \t7.99997261189\t8\t-2.7E-05\tOK\t\u0026lt;—— Most rounding yielding \"OK\"\r\n 4.03        \t7.99692609695\t8\t-3.1E-03\tToo big\r\n 4.0         \t7.90569415042\t8\t-9.4E-02\tToo big\r\n 4.          \t7.90569415042\t8\t-9.4E-02\tToo big\u003c/pre\u003e","function_template":"function x = myFunction(A),\r\n    foo = bar; \r\nend","test_suite":"%% Anti-hacking code.  Hacking of the Test Suite is not allowed!  Additional restrictions will be added if necessary.  \r\nassessFunctionAbsence({'rng', ...        By the way, with an ellipsis (signalling line continuation) \r\n    '!', 'assert', ...                   all subsequent material on that line is ignored.  But syntactically they \r\n    'evalin', 'assignin', ...            are _not_ comments (even if they are \"effectively\" similar).           \r\n    'system', 'dos', ...                 E.g. they would not be treated as comments by an autodoc (automatic documentation) tool.  \r\n    'unix'}, 'FileName', 'myFunction.m')\r\nassert( isempty( regexp(fileread('myFunction.m'),'(?# By the way, comments can also be inserted in regexp \"regular expression\" arguments.)assert','match') ) , 'No \"assert\" allowed in your code!')\r\n\r\n%% Check for comments.  Interestingly, submissions are automatically appended with e.g.  '%This code written by profile_id 1972666'\r\ncommentType1 = regexp(fileread('myFunction.m'),'(?\u003c![\\f\\n\\r][^'']*''[^''\\f\\n\\r]*)(?\u003c!\\o45)\\o45[^\\o45][^\\f\\n\\r]{10,}','match');\r\ncommentType1(end) = []\r\nassert( ~isempty( commentType1 ) , 'Basic comment type missing or too short.')\r\n\r\ncommentType2 = regexp(fileread('myFunction.m'),'\\o45\\o45[^\\f\\n\\r]{10,}','match')\r\nassert( ~isempty( commentType2 ) , 'Delimiting comment type missing or too short.')\r\n\r\ncommentType3open  = regexp(fileread('myFunction.m'),'(^|[\\f\\n\\r]*)\\x{20}*\\o45\\o173\\x{20}*[\\f\\n\\r]')\r\ncommentType3close = regexp(fileread('myFunction.m'),'(^|[\\f\\n\\r]*)\\x{20}*\\o45\\o175\\x{20}*[\\f\\n\\r]')\r\nif isempty(commentType3open) || isempty(commentType3open)\r\n    assert(false, 'Block comment type missing.')\r\nelse\r\n    assert( length(commentType3close) == length(commentType3open) , 'Block comment tokens unbalanced.')\r\n    assert( max(commentType3close - commentType3open) \u003e 20 , 'Block comment type too short.')\r\nend;\r\n\r\n%% The first of the arithmetic tests\r\nA = 1;\r\nx_correct = 1.3572;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 2;\r\nx_correct = 1.7652;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 3;\r\nx_correct = 2.1898;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 4;\r\nx_correct = 2.59625;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 5;\r\nx_correct = 2.9814;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 6;\r\nx_correct = 3.3472;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 7;\r\nx_correct = 3.6963;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 8;\r\nx_correct = 4.031;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 9;\r\nx_correct = 4.3533;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 10;\r\nx_correct = 4.6647;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 481;\r\nx_correct = 61.39;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 922;\r\nx_correct = 94.73;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 3981;\r\nx_correct = 251.185635;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 3988;\r\nx_correct = 251.48;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 3989;\r\nx_correct = 251.522035;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 7997;\r\nx_correct = 399.9;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 8000;\r\nx_correct = 400;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 8003;\r\nx_correct = 400.1;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%% Random inputs\r\nthreshold = 0.0001;\r\n\r\nfor j = 1 : 10\r\n\r\n    A = randi(10) + rand();\r\n    x_candidate = myFunction(A);\r\n    A_approx = exp( log(x_candidate * x_candidate * x_candidate - (1 + 1/2)) / 2);\r\n    assert( abs(A - A_approx) \u003c= threshold )\r\n    \r\n    x_rough = round(x_candidate, 6);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 5);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 4);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 3);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 2);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 1);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n\r\nend;","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":"2019-06-24T10:16:30.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2017-11-14T12:48:47.000Z","updated_at":"2019-06-24T10:16:30.000Z","published_at":"2017-11-15T04:36: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\",\"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\u003eOne of the most useful skills a programmer can develop is the skill — or habit — of writing descriptive comments within/above the code that they work on.\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\u003eTop reasons for including comments in one's code:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHelpful while you are initially developing the code.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHelpful if you are collaborating on the development, so others need to be able to use/amend/revise it.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHelpful if you need to revisit the code later on (could be months or years later), such as to extend it or amend it.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHelpful if someone else may work on the code in future, such as to extend it or amend it.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHelpful on Cody for other players who can learn from inspecting your code.\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\u003eMATLAB provides\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ethree\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e main methods of adding\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/matlab_prog/comments.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecomments\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e to your code:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecomments;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecomments also serving as 'code section' delimiters \u0026amp; titles (these may be more appropriate in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/scripts.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003escripts\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e than within\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/functions.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efunctions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, but it is still possible to practice using them here);\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eblock comments.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote: some other features of MATLAB that are related to comments are illustrated at the top of the Test Suite, but are outside the present scope. Specifically, ellipsis (...) is deemed here a technique primarily for line continuation, not primarily for adding descriptions to the code.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eYour PRIMARY task is to utilize\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eall three\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e comment styles in your submission.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Your comments will have to be of 'meaningful' length (i.e. not so short as to have no clear meaning).\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\u003eHowever, to make it slightly more interesting — and to have something specific to comment upon — as a\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\u003eSECONDARY task\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e you will also have to solve the equation\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e√(x³ − 3/2) = A\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efor x (find x), in which A is a constant that will be provided as an input. \\\"√\\\" represents the square-root radical sign. Note that generally x will\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be an 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMoreover, your result should be returned\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003erounded\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (in the usual way) to the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eminimum\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e number of decimal places so that the left-hand side of the equation will be within the span defined by \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\u003eA ± 0.0001\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[A = 8\\nx = 4.031]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe exact value of x is more accurately approximated as 4.031008989457290. However, this is more than the minimum required precision. By setting x = 4.031, the left-hand side of the equation yields 7.999973, which is only 0.000027 less than the target value of A, and therefore acceptable. Note that more aggressive rounding of x to x = 4.03 would yield an unacceptably poor estimate for A, namely 7.996926 (an error of 0.003074). See also the table below:\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          √(x³ − 3/2)  A    Error     Error size\\n 4.0310089895  8.00000000013  8  +1.3E-10  OK\\n 4.031008990   8.00000000165  8  +1.7E-09  OK\\n 4.03100899    8.00000000165  8  +1.7E-09  OK\\n 4.0310090     8.00000003212  8  +3.2E-08  OK\\n 4.031009      8.00000003212  8  +3.2E-08  OK\\n 4.03101       8.00000307881  8  +3.1E-06  OK\\n 4.0310        7.99997261189  8  -2.7E-05  OK\\n 4.031         7.99997261189  8  -2.7E-05  OK  \u003c—— Most rounding yielding \\\"OK\\\"\\n 4.03          7.99692609695  8  -3.1E-03  Too big\\n 4.0           7.90569415042  8  -9.4E-02  Too big\\n 4.            7.90569415042  8  -9.4E-02  Too big]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":44405,"title":"Back to basics:  adding comments to your code","description":"One of the most useful skills a programmer can develop is the skill — or habit — of writing descriptive comments within/above the code that they work on.  \r\n\r\nTop reasons for including comments in one's code:\r\n\r\n# Helpful while you are initially developing the code.\r\n# Helpful if you are collaborating on the development, so others need to be able to use/amend/revise it.  \r\n# Helpful if you need to revisit the code later on (could be months or years later), such as to extend it or amend it.  \r\n# Helpful if someone else may work on the code in future, such as to extend it or amend it. \r\n# *Helpful on Cody for other players who can learn from inspecting your code.*\r\n\r\nMATLAB provides _three_ main methods of adding \u003chttps://au.mathworks.com/help/matlab/matlab_prog/comments.html comments\u003e to your code:\r\n\r\n* comments;\r\n* comments also serving as 'code section' delimiters \u0026 titles (these may be more appropriate in \u003chttps://au.mathworks.com/help/matlab/scripts.html scripts\u003e  than within \u003chttps://au.mathworks.com/help/matlab/functions.html functions\u003e, but it is still possible to practice using them here);\r\n* block comments.  \r\n\r\n_Note:  some other features of MATLAB that are related to comments are illustrated at the top of the Test Suite, but are outside the present scope. Specifically, ellipsis (...) is deemed here a technique primarily for line continuation, not primarily for adding descriptions to the code._\r\n \r\n*Your PRIMARY task is to utilize _all three_ comment styles in your submission.*  Your comments will have to be of 'meaningful' length (i.e. not so short as to have no clear meaning).\r\n\r\nHowever, to make it slightly more interesting — and to have something specific to comment upon — as a *SECONDARY task* you will also have to solve the equation \r\n\r\n*√(x³ − 3/2) = A*\r\n\r\nfor x (find x), in which A is a constant that will be provided as an input.  \"√\" represents the square-root radical sign.  Note that generally x will _not_ be an integer.  \r\n\r\nMoreover, your result should be returned _rounded_ (in the usual way) to the _minimum_ number of decimal places so that the left-hand side of the equation will be within the span defined by  *A ± 0.0001*.  \r\n\r\nEXAMPLE\r\n\r\n  A = 8\r\n  x = 4.031\r\n\r\nThe exact value of x is more accurately approximated as 4.031008989457290.  However, this is more than the minimum required precision.  \r\nBy setting x = 4.031, the left-hand side of the equation yields 7.999973, which is only 0.000027 less than the target value of A, and therefore acceptable.  \r\nNote that more aggressive rounding of x to x = 4.03 would yield an unacceptably poor estimate for A, namely 7.996926 (an error of 0.003074).  See also the table below:\r\n\r\n x\t        √(x³ − 3/2)\tA  \tError   \tError size\r\n 4.0310089895\t8.00000000013\t8\t+1.3E-10\tOK\r\n 4.031008990 \t8.00000000165\t8\t+1.7E-09\tOK\r\n 4.03100899  \t8.00000000165\t8\t+1.7E-09\tOK\r\n 4.0310090   \t8.00000003212\t8\t+3.2E-08\tOK\r\n 4.031009    \t8.00000003212\t8\t+3.2E-08\tOK\r\n 4.03101     \t8.00000307881\t8\t+3.1E-06\tOK\r\n 4.0310      \t7.99997261189\t8\t-2.7E-05\tOK\r\n 4.031       \t7.99997261189\t8\t-2.7E-05\tOK\t\u003c—— Most rounding yielding \"OK\"\r\n 4.03        \t7.99692609695\t8\t-3.1E-03\tToo big\r\n 4.0         \t7.90569415042\t8\t-9.4E-02\tToo big\r\n 4.          \t7.90569415042\t8\t-9.4E-02\tToo big","description_html":"\u003cp\u003eOne of the most useful skills a programmer can develop is the skill — or habit — of writing descriptive comments within/above the code that they work on.\u003c/p\u003e\u003cp\u003eTop reasons for including comments in one's code:\u003c/p\u003e\u003col\u003e\u003cli\u003eHelpful while you are initially developing the code.\u003c/li\u003e\u003cli\u003eHelpful if you are collaborating on the development, so others need to be able to use/amend/revise it.\u003c/li\u003e\u003cli\u003eHelpful if you need to revisit the code later on (could be months or years later), such as to extend it or amend it.\u003c/li\u003e\u003cli\u003eHelpful if someone else may work on the code in future, such as to extend it or amend it.\u003c/li\u003e\u003cli\u003e\u003cb\u003eHelpful on Cody for other players who can learn from inspecting your code.\u003c/b\u003e\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eMATLAB provides \u003ci\u003ethree\u003c/i\u003e main methods of adding \u003ca href = \"https://au.mathworks.com/help/matlab/matlab_prog/comments.html\"\u003ecomments\u003c/a\u003e to your code:\u003c/p\u003e\u003cul\u003e\u003cli\u003ecomments;\u003c/li\u003e\u003cli\u003ecomments also serving as 'code section' delimiters \u0026 titles (these may be more appropriate in \u003ca href = \"https://au.mathworks.com/help/matlab/scripts.html\"\u003escripts\u003c/a\u003e  than within \u003ca href = \"https://au.mathworks.com/help/matlab/functions.html\"\u003efunctions\u003c/a\u003e, but it is still possible to practice using them here);\u003c/li\u003e\u003cli\u003eblock comments.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003ci\u003eNote:  some other features of MATLAB that are related to comments are illustrated at the top of the Test Suite, but are outside the present scope. Specifically, ellipsis (...) is deemed here a technique primarily for line continuation, not primarily for adding descriptions to the code.\u003c/i\u003e\u003c/p\u003e\u003cp\u003e\u003cb\u003eYour PRIMARY task is to utilize \u003ci\u003eall three\u003c/i\u003e comment styles in your submission.\u003c/b\u003e  Your comments will have to be of 'meaningful' length (i.e. not so short as to have no clear meaning).\u003c/p\u003e\u003cp\u003eHowever, to make it slightly more interesting — and to have something specific to comment upon — as a \u003cb\u003eSECONDARY task\u003c/b\u003e you will also have to solve the equation\u003c/p\u003e\u003cp\u003e\u003cb\u003e√(x³ − 3/2) = A\u003c/b\u003e\u003c/p\u003e\u003cp\u003efor x (find x), in which A is a constant that will be provided as an input.  \"√\" represents the square-root radical sign.  Note that generally x will \u003ci\u003enot\u003c/i\u003e be an integer.\u003c/p\u003e\u003cp\u003eMoreover, your result should be returned \u003ci\u003erounded\u003c/i\u003e (in the usual way) to the \u003ci\u003eminimum\u003c/i\u003e number of decimal places so that the left-hand side of the equation will be within the span defined by  \u003cb\u003eA ± 0.0001\u003c/b\u003e.\u003c/p\u003e\u003cp\u003eEXAMPLE\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eA = 8\r\nx = 4.031\r\n\u003c/pre\u003e\u003cp\u003eThe exact value of x is more accurately approximated as 4.031008989457290.  However, this is more than the minimum required precision.  \r\nBy setting x = 4.031, the left-hand side of the equation yields 7.999973, which is only 0.000027 less than the target value of A, and therefore acceptable.  \r\nNote that more aggressive rounding of x to x = 4.03 would yield an unacceptably poor estimate for A, namely 7.996926 (an error of 0.003074).  See also the table below:\u003c/p\u003e\u003cpre\u003e x\t        √(x³ − 3/2)\tA  \tError   \tError size\r\n 4.0310089895\t8.00000000013\t8\t+1.3E-10\tOK\r\n 4.031008990 \t8.00000000165\t8\t+1.7E-09\tOK\r\n 4.03100899  \t8.00000000165\t8\t+1.7E-09\tOK\r\n 4.0310090   \t8.00000003212\t8\t+3.2E-08\tOK\r\n 4.031009    \t8.00000003212\t8\t+3.2E-08\tOK\r\n 4.03101     \t8.00000307881\t8\t+3.1E-06\tOK\r\n 4.0310      \t7.99997261189\t8\t-2.7E-05\tOK\r\n 4.031       \t7.99997261189\t8\t-2.7E-05\tOK\t\u0026lt;—— Most rounding yielding \"OK\"\r\n 4.03        \t7.99692609695\t8\t-3.1E-03\tToo big\r\n 4.0         \t7.90569415042\t8\t-9.4E-02\tToo big\r\n 4.          \t7.90569415042\t8\t-9.4E-02\tToo big\u003c/pre\u003e","function_template":"function x = myFunction(A),\r\n    foo = bar; \r\nend","test_suite":"%% Anti-hacking code.  Hacking of the Test Suite is not allowed!  Additional restrictions will be added if necessary.  \r\nassessFunctionAbsence({'rng', ...        By the way, with an ellipsis (signalling line continuation) \r\n    '!', 'assert', ...                   all subsequent material on that line is ignored.  But syntactically they \r\n    'evalin', 'assignin', ...            are _not_ comments (even if they are \"effectively\" similar).           \r\n    'system', 'dos', ...                 E.g. they would not be treated as comments by an autodoc (automatic documentation) tool.  \r\n    'unix'}, 'FileName', 'myFunction.m')\r\nassert( isempty( regexp(fileread('myFunction.m'),'(?# By the way, comments can also be inserted in regexp \"regular expression\" arguments.)assert','match') ) , 'No \"assert\" allowed in your code!')\r\n\r\n%% Check for comments.  Interestingly, submissions are automatically appended with e.g.  '%This code written by profile_id 1972666'\r\ncommentType1 = regexp(fileread('myFunction.m'),'(?\u003c![\\f\\n\\r][^'']*''[^''\\f\\n\\r]*)(?\u003c!\\o45)\\o45[^\\o45][^\\f\\n\\r]{10,}','match');\r\ncommentType1(end) = []\r\nassert( ~isempty( commentType1 ) , 'Basic comment type missing or too short.')\r\n\r\ncommentType2 = regexp(fileread('myFunction.m'),'\\o45\\o45[^\\f\\n\\r]{10,}','match')\r\nassert( ~isempty( commentType2 ) , 'Delimiting comment type missing or too short.')\r\n\r\ncommentType3open  = regexp(fileread('myFunction.m'),'(^|[\\f\\n\\r]*)\\x{20}*\\o45\\o173\\x{20}*[\\f\\n\\r]')\r\ncommentType3close = regexp(fileread('myFunction.m'),'(^|[\\f\\n\\r]*)\\x{20}*\\o45\\o175\\x{20}*[\\f\\n\\r]')\r\nif isempty(commentType3open) || isempty(commentType3open)\r\n    assert(false, 'Block comment type missing.')\r\nelse\r\n    assert( length(commentType3close) == length(commentType3open) , 'Block comment tokens unbalanced.')\r\n    assert( max(commentType3close - commentType3open) \u003e 20 , 'Block comment type too short.')\r\nend;\r\n\r\n%% The first of the arithmetic tests\r\nA = 1;\r\nx_correct = 1.3572;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 2;\r\nx_correct = 1.7652;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 3;\r\nx_correct = 2.1898;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 4;\r\nx_correct = 2.59625;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 5;\r\nx_correct = 2.9814;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 6;\r\nx_correct = 3.3472;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 7;\r\nx_correct = 3.6963;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 8;\r\nx_correct = 4.031;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 9;\r\nx_correct = 4.3533;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\nA = 10;\r\nx_correct = 4.6647;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 481;\r\nx_correct = 61.39;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 922;\r\nx_correct = 94.73;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 3981;\r\nx_correct = 251.185635;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 3988;\r\nx_correct = 251.48;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 3989;\r\nx_correct = 251.522035;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 7997;\r\nx_correct = 399.9;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 8000;\r\nx_correct = 400;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%%\r\n% Test added 2019-06-24\r\nA = 8003;\r\nx_correct = 400.1;\r\nassert( isequal(myFunction(A), x_correct) )\r\n\r\n%% Random inputs\r\nthreshold = 0.0001;\r\n\r\nfor j = 1 : 10\r\n\r\n    A = randi(10) + rand();\r\n    x_candidate = myFunction(A);\r\n    A_approx = exp( log(x_candidate * x_candidate * x_candidate - (1 + 1/2)) / 2);\r\n    assert( abs(A - A_approx) \u003c= threshold )\r\n    \r\n    x_rough = round(x_candidate, 6);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 5);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 4);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 3);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 2);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n    \r\n    x_rough = round(x_candidate, 1);\r\n    if abs(x_rough - x_candidate) \u003e 10*eps(x_candidate)\r\n        A_rough = exp( log(x_rough * x_rough * x_rough - (1 + 1/2)) / 2);\r\n        assert( abs(A - A_rough) \u003e threshold )\r\n    end;    \r\n\r\nend;","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":64439,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":"2019-06-24T10:16:30.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2017-11-14T12:48:47.000Z","updated_at":"2019-06-24T10:16:30.000Z","published_at":"2017-11-15T04:36: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\",\"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\u003eOne of the most useful skills a programmer can develop is the skill — or habit — of writing descriptive comments within/above the code that they work on.\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\u003eTop reasons for including comments in one's code:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHelpful while you are initially developing the code.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHelpful if you are collaborating on the development, so others need to be able to use/amend/revise it.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHelpful if you need to revisit the code later on (could be months or years later), such as to extend it or amend it.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHelpful if someone else may work on the code in future, such as to extend it or amend it.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHelpful on Cody for other players who can learn from inspecting your code.\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\u003eMATLAB provides\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ethree\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e main methods of adding\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/matlab_prog/comments.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ecomments\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e to your code:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecomments;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ecomments also serving as 'code section' delimiters \u0026amp; titles (these may be more appropriate in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/scripts.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003escripts\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e than within\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://au.mathworks.com/help/matlab/functions.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efunctions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, but it is still possible to practice using them here);\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eblock comments.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eNote: some other features of MATLAB that are related to comments are illustrated at the top of the Test Suite, but are outside the present scope. Specifically, ellipsis (...) is deemed here a technique primarily for line continuation, not primarily for adding descriptions to the code.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eYour PRIMARY task is to utilize\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eall three\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e comment styles in your submission.\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Your comments will have to be of 'meaningful' length (i.e. not so short as to have no clear meaning).\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\u003eHowever, to make it slightly more interesting — and to have something specific to comment upon — as a\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\u003eSECONDARY task\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e you will also have to solve the equation\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e√(x³ − 3/2) = A\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003efor x (find x), in which A is a constant that will be provided as an input. \\\"√\\\" represents the square-root radical sign. Note that generally x will\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003enot\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be an 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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMoreover, your result should be returned\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003erounded\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (in the usual way) to the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eminimum\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e number of decimal places so that the left-hand side of the equation will be within the span defined by \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\u003eA ± 0.0001\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eEXAMPLE\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[A = 8\\nx = 4.031]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe exact value of x is more accurately approximated as 4.031008989457290. However, this is more than the minimum required precision. By setting x = 4.031, the left-hand side of the equation yields 7.999973, which is only 0.000027 less than the target value of A, and therefore acceptable. Note that more aggressive rounding of x to x = 4.03 would yield an unacceptably poor estimate for A, namely 7.996926 (an error of 0.003074). See also the table below:\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          √(x³ − 3/2)  A    Error     Error size\\n 4.0310089895  8.00000000013  8  +1.3E-10  OK\\n 4.031008990   8.00000000165  8  +1.7E-09  OK\\n 4.03100899    8.00000000165  8  +1.7E-09  OK\\n 4.0310090     8.00000003212  8  +3.2E-08  OK\\n 4.031009      8.00000003212  8  +3.2E-08  OK\\n 4.03101       8.00000307881  8  +3.1E-06  OK\\n 4.0310        7.99997261189  8  -2.7E-05  OK\\n 4.031         7.99997261189  8  -2.7E-05  OK  \u003c—— Most rounding yielding \\\"OK\\\"\\n 4.03          7.99692609695  8  -3.1E-03  Too big\\n 4.0           7.90569415042  8  -9.4E-02  Too big\\n 4.            7.90569415042  8  -9.4E-02  Too big]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"comments\"","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:\"comments\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"comments\"","","\"","comments","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f35672b26d8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f35672b2638\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f35672b1cd8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f35672b29f8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f35672b28b8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f35672b2818\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f35672b2778\u003e":"tag:\"comments\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f35672b2778\u003e":"tag:\"comments\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"cody-search","password":"78X075ddcV44","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"comments\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"comments\"","","\"","comments","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f35672b26d8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f35672b2638\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f35672b1cd8\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f35672b29f8\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f35672b28b8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f35672b2818\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f35672b2778\u003e":"tag:\"comments\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f35672b2778\u003e":"tag:\"comments\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":44405,"difficulty_rating":"easy-medium"}]}}