{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-04-06T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":46736,"title":"Round to Nearest Multiple of 10^n","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 102px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 148px 51px; transform-origin: 148px 51px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 125px 21px; text-align: left; transform-origin: 125px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eRound the given number , x to nearest multiple of 10^n\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: 125px 10.5px; text-align: left; transform-origin: 125px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eexample x = 8137, n= 2, then y =8100\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: 125px 10.5px; text-align: left; transform-origin: 125px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = round_10_n(x,n)\r\n  y = x*n;\r\nend","test_suite":"%%\r\nx = 8137;\r\nn=2;\r\ny_correct = 8100;\r\nassert(isequal(round_10_n(x,n),y_correct))\r\n\r\n%%\r\nx=45321;\r\nn=3;\r\ny_correct = 45000;\r\nassert(isequal(round_10_n(x,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":144669,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":86,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-12T23:44:34.000Z","updated_at":"2026-02-26T12:03:45.000Z","published_at":"2020-10-12T23:44:34.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\u003eRound the given number , x to nearest multiple of 10^n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eexample x = 8137, n= 2, then y =8100\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44228,"title":"Who have the chance?","description":"Obtain a free 10 score in cody, if you have a chance don't change anything if you want to try or do what you can do to gain for the first time.\r\n in this function must the output be the same as in test to win.\r\n\r\nLet me see you guys!!","description_html":"\u003cp\u003eObtain a free 10 score in cody, if you have a chance don't change anything if you want to try or do what you can do to gain for the first time.\r\n in this function must the output be the same as in test to win.\u003c/p\u003e\u003cp\u003eLet me see you guys!!\u003c/p\u003e","function_template":"function y = your_chance()\r\n  y = round(rand(1,3));\r\nend","test_suite":"%%\r\nfiletext = fileread('your_chance.m'); \r\n%%\r\nassert(isequal(your_chance(),round(rand(1,3))))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":37163,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":"2017-06-03T01:48:34.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-05-29T17:27:55.000Z","updated_at":"2026-02-20T14:06:56.000Z","published_at":"2017-05-29T17:27: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\u003eObtain a free 10 score in cody, if you have a chance don't change anything if you want to try or do what you can do to gain for the first time. in this function must the output be the same as in test to win.\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\u003eLet me see you guys!!\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":43148,"title":"Basic commands - rounding","description":"make a function which will round to integer, which is nearer to zero.\r\n\r\nExample \r\n\r\n  x=[-2.5 2];\r\n  y=[-2 2];","description_html":"\u003cp\u003emake a function which will round to integer, which is nearer to zero.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex=[-2.5 2];\r\ny=[-2 2];\r\n\u003c/pre\u003e","function_template":"function y = round20(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [-2.5 2.5];\r\ny_correct = [-2 2];\r\nassert(isequal(round20(x),y_correct))\r\n\r\n%%\r\nx = [-8.3 0.01 7.9];\r\ny_correct = [-8 0 7];\r\nassert(isequal(round20(x),y_correct))","published":true,"deleted":false,"likes_count":25,"comments_count":0,"created_by":90955,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":226,"test_suite_updated_at":"2016-10-07T11:28:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T11:28:01.000Z","updated_at":"2026-02-18T10:15:58.000Z","published_at":"2016-10-07T11:28:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003emake a function which will round to integer, which is nearer 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=[-2.5 2];\\ny=[-2 2];]]\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":45392,"title":"Convert a temperature reading from Celsius to an unknown scale","description":"Two of the most famous temperature scales are the Celsius and the Fahrenheit scale. In reality, however, there are so many other temperature scales used in the chemical industry. \r\n \r\nLet's assume that all temperature conversions are of the form Y = AX + B where A and B are conversion constants, and X and Y are the temperature readings. If you are given two sample conversions from one scale to another, then you can convert any other value to and from that scale with this assumption. Take the Rankine scale for example. If we know that 476.85 degrees Celsius converts to 1350 degrees Rankine and 226.85 degrees Celsius converts to 900 degrees Rankine, then we can compute that 40 degrees Celsius is equal to 563.67 degrees Rankine.\r\n \r\nMake a program that accepts 5 decimal numbers X1, Y1, X2, Y2, and T. Let’s name a new temperature scale 'Franklin'. If X1 degrees Celsius convert to Y1 degrees Franklin and X2 degrees Celsius convert to Y2 degrees Franklin, output a decimal number, rounded to 2 decimal places, denoting the degrees Franklin equivalent of T degrees Celsius. You are guaranteed that:\r\n\r\n* All inputs are in the range [-1000, 1000].\r\n* Each test case is valid and has a unique solution.\r\n","description_html":"\u003cp\u003eTwo of the most famous temperature scales are the Celsius and the Fahrenheit scale. In reality, however, there are so many other temperature scales used in the chemical industry.\u003c/p\u003e\u003cp\u003eLet's assume that all temperature conversions are of the form Y = AX + B where A and B are conversion constants, and X and Y are the temperature readings. If you are given two sample conversions from one scale to another, then you can convert any other value to and from that scale with this assumption. Take the Rankine scale for example. If we know that 476.85 degrees Celsius converts to 1350 degrees Rankine and 226.85 degrees Celsius converts to 900 degrees Rankine, then we can compute that 40 degrees Celsius is equal to 563.67 degrees Rankine.\u003c/p\u003e\u003cp\u003eMake a program that accepts 5 decimal numbers X1, Y1, X2, Y2, and T. Let’s name a new temperature scale 'Franklin'. If X1 degrees Celsius convert to Y1 degrees Franklin and X2 degrees Celsius convert to Y2 degrees Franklin, output a decimal number, rounded to 2 decimal places, denoting the degrees Franklin equivalent of T degrees Celsius. You are guaranteed that:\u003c/p\u003e\u003cul\u003e\u003cli\u003eAll inputs are in the range [-1000, 1000].\u003c/li\u003e\u003cli\u003eEach test case is valid and has a unique solution.\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = celsius_to_franklin(X1,Y1,X2,Y2,T)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(celsius_to_franklin(605.86,942.86,701.08,873.83,981.92),670.23))\r\n%%\r\nassert(isequal(celsius_to_franklin(-283.48,-820.99,34.93,-540.53,578.22),-61.99))\r\n%%\r\nassert(isequal(celsius_to_franklin(-642.38,-545.91,-236.27,259.69,641.57),2001.06))\r\n%%\r\nassert(isequal(celsius_to_franklin(-388.76,740.12,-355.52,996.42,156.00),4940.54))\r\n%%\r\nassert(isequal(celsius_to_franklin(-424.57,-136.40,-544.47,-598.13,-454.91),-253.24))\r\n%%\r\nassert(isequal(celsius_to_franklin(-943.67,428.22,-381.09,-96.63,823.88),-1220.79))\r\n%%\r\nassert(isequal(celsius_to_franklin(205.93,437.77,-539.18,6.82,-447.39),59.91))\r\n%%\r\nassert(isequal(celsius_to_franklin(863.18,284.69,-263.58,368.62,926.41),279.98))\r\n%%\r\nassert(isequal(celsius_to_franklin(-147.74,127.01,-672.12,-960.23,-492.42),-587.64))\r\n%%\r\nassert(isequal(celsius_to_franklin(-470.00,-330.01,245.92,32.44,368.50),94.50))\r\n%%\r\nassert(isequal(celsius_to_franklin(-953.62,-685.32,-111.79,461.55,-660.24),-285.63))\r\n%%\r\nassert(isequal(celsius_to_franklin(657.17,897.22,-335.17,803.76,-866.72),753.70))\r\n%%\r\nassert(isequal(celsius_to_franklin(584.48,-166.12,259.41,-70.18,555.04),-157.43))\r\n%%\r\nassert(isequal(celsius_to_franklin(-409.79,-416.75,-96.33,609.90,-841.00),-1829.06))\r\n%%\r\nassert(isequal(celsius_to_franklin(-307.20,-48.77,366.97,569.72,-590.24),-308.43))\r\n%%\r\nassert(isequal(celsius_to_franklin(-640.68,-365.85,-741.44,-757.17,-230.91),1225.57))\r\n%%\r\nassert(isequal(celsius_to_franklin(-132.47,214.18,-277.77,782.82,-612.67),2093.47))\r\n%%\r\nassert(isequal(celsius_to_franklin(-690.34,-308.03,216.70,-736.01,-355.91),-465.83))\r\n%%\r\nassert(isequal(celsius_to_franklin(927.61,379.39,698.87,962.06,-538.43),4113.84))\r\n%%\r\nassert(isequal(celsius_to_franklin(-886.01,-463.51,756.77,803.12,87.47),287.07))\r\n%%\r\nassert(isequal(celsius_to_franklin(-502.42,-588.56,-206.72,-98.65,321.02),775.70))\r\n%%\r\nassert(isequal(celsius_to_franklin(-153.74,7.78,-682.05,-719.25,120.16),384.71))\r\n%%\r\nassert(isequal(celsius_to_franklin(-144.83,-134.94,-189.12,-37.86,-515.74),678.06))\r\n%%\r\nassert(isequal(celsius_to_franklin(-995.20,151.44,-741.17,-470.43,-406.85),-1288.85))\r\n%%\r\nassert(isequal(celsius_to_franklin(871.26,-14.30,236.99,-926.20,-443.03),-1903.88))\r\n%%\r\nassert(isequal(celsius_to_franklin(715.15,782.47,47.57,-466.79,44.72),-472.12))\r\n%%\r\nassert(isequal(celsius_to_franklin(899.12,-837.45,-191.19,-256.33,-293.28),-201.92))\r\n%%\r\nassert(isequal(celsius_to_franklin(-202.59,-537.15,-192.74,407.01,299.90),47628.43))\r\n%%\r\nassert(isequal(celsius_to_franklin(913.66,334.21,33.59,-112.18,-55.21),-157.22))\r\n%%\r\nassert(isequal(celsius_to_franklin(955.44,756.25,-738.91,-848.13,114.84),-39.71))\r\n%%\r\nassert(isequal(celsius_to_franklin(-666.83,-718.81,55.93,-298.83,-586.09),-671.89))\r\n%%\r\nassert(isequal(celsius_to_franklin(147.36,-107.49,37.96,373.14,543.46),-1847.69))\r\n%%\r\nassert(isequal(celsius_to_franklin(-187.90,-485.31,-936.87,953.10,-349.60),-174.76))\r\n%%\r\nassert(isequal(celsius_to_franklin(-341.01,93.29,-190.04,507.03,-51.48),886.76))\r\n%%\r\nassert(isequal(celsius_to_franklin(584.80,435.13,-16.48,-899.54,29.33),-797.85))\r\n%%\r\nassert(isequal(celsius_to_franklin(-340.40,903.99,-371.65,-204.97,884.36),44366.71))\r\n%%\r\nassert(isequal(celsius_to_franklin(-781.65,-583.60,127.07,910.74,-822.91),-651.45))\r\n%%\r\nassert(isequal(celsius_to_franklin(-386.75,-935.79,531.29,-280.34,-408.39),-951.24))\r\n%%\r\nassert(isequal(celsius_to_franklin(161.90,440.48,-210.43,-49.91,269.72),582.49))\r\n%%\r\nassert(isequal(celsius_to_franklin(-748.00,558.83,611.62,-70.60,-33.59),228.10))\r\n%%\r\nassert(isequal(celsius_to_franklin(657.96,-975.96,777.84,21.10,-407.55),-9837.97))\r\n%%\r\nassert(isequal(celsius_to_franklin(-230.46,-919.89,-284.33,499.32,-234.82),-805.03))\r\n%%\r\nassert(isequal(celsius_to_franklin(-301.12,-825.93,814.58,-552.94,507.82),-628.00))\r\n%%\r\nassert(isequal(celsius_to_franklin(697.75,701.18,10.89,34.27,653.33),658.05))\r\n%%\r\nassert(isequal(celsius_to_franklin(280.00,888.78,-786.06,403.46,708.18),1083.71))\r\n%%\r\nassert(isequal(celsius_to_franklin(-10.67,543.28,264.36,637.92,894.65),854.81))\r\n%%\r\nassert(isequal(celsius_to_franklin(-206.85,153.56,-128.64,-453.56,89.79),-2149.16))\r\n%%\r\nassert(isequal(celsius_to_franklin(-76.51,-747.71,305.05,982.05,-576.62),-3014.90))\r\n%%\r\nassert(isequal(celsius_to_franklin(292.10,-573.74,-958.20,-149.66,113.10),-513.03))\r\n%%\r\nassert(isequal(celsius_to_franklin(792.56,-79.19,-775.41,-838.95,-698.15),-801.51))\r\n%%\r\nassert(isequal(celsius_to_franklin(-396.81,922.69,629.52,-216.29,678.00),-270.09))\r\n%%\r\nassert(isequal(celsius_to_franklin(-517.35,852.83,-16.57,-944.12,849.97),-4053.53))\r\n%%\r\nassert(isequal(celsius_to_franklin(-434.10,504.36,-908.25,-132.70,317.96),1514.82))\r\n%%\r\nassert(isequal(celsius_to_franklin(829.18,913.01,168.51,348.27,731.39),829.42))\r\n%%\r\nassert(isequal(celsius_to_franklin(-333.40,-166.89,-456.37,639.93,-427.43),450.05))\r\n%%\r\nassert(isequal(celsius_to_franklin(-294.90,-60.17,550.47,304.60,671.10),356.65))\r\n%%\r\nassert(isequal(celsius_to_franklin(485.15,789.20,766.49,210.31,465.73),829.16))\r\n%%\r\nassert(isequal(celsius_to_franklin(203.09,-17.32,914.47,-533.31,-199.58),274.75))\r\n%%\r\nassert(isequal(celsius_to_franklin(966.57,445.31,-794.28,-130.59,-831.11),-142.64))\r\n%%\r\nassert(isequal(celsius_to_franklin(-738.77,-731.47,-714.39,984.04,-269.54),32286.12))\r\n%%\r\nassert(isequal(celsius_to_franklin(930.51,64.10,-449.17,775.23,87.89),498.41))\r\n%%\r\nassert(isequal(celsius_to_franklin(-868.15,640.06,347.72,-454.46,17.03),-156.77))\r\n%%\r\nassert(isequal(celsius_to_franklin(-937.82,569.83,-404.13,866.50,-171.47),995.83))\r\n%%\r\nassert(isequal(celsius_to_franklin(-169.08,901.62,-131.93,-661.45,-597.44),18924.68))\r\n%%\r\nassert(isequal(celsius_to_franklin(-189.62,-713.35,-270.02,-220.67,637.73),-5783.24))\r\n%%\r\nassert(isequal(celsius_to_franklin(492.42,-319.45,141.79,288.15,113.21),337.68))\r\n%%\r\nassert(isequal(celsius_to_franklin(283.90,-538.88,-437.08,918.34,-115.93),269.24))\r\n%%\r\nassert(isequal(celsius_to_franklin(-306.06,561.45,469.95,418.77,357.52),439.44))\r\n%%\r\nassert(isequal(celsius_to_franklin(-750.15,755.17,-347.75,-855.09,549.57),-4445.84))\r\n%%\r\nassert(isequal(celsius_to_franklin(-522.01,440.91,261.38,-459.71,195.94),-384.48))\r\n%%\r\nassert(isequal(celsius_to_franklin(741.61,107.09,454.92,-904.42,-603.83),-4639.94))\r\n%%\r\nassert(isequal(celsius_to_franklin(91.21,547.62,235.88,78.98,176.30),271.98))\r\n%%\r\nassert(isequal(celsius_to_franklin(970.32,-331.81,24.95,989.19,396.94),469.39))\r\n%%\r\nassert(isequal(celsius_to_franklin(573.18,-145.55,-501.14,406.38,-809.38),564.74))\r\n%%\r\nassert(isequal(celsius_to_franklin(674.12,182.10,-769.93,-438.99,216.83),-14.58))\r\n%%\r\nassert(isequal(celsius_to_franklin(-501.54,364.36,122.84,736.62,105.33),726.18))\r\n%%\r\nassert(isequal(celsius_to_franklin(423.69,-98.78,-153.62,-130.92,663.06),-85.45))\r\n%%\r\nassert(isequal(celsius_to_franklin(796.67,-66.87,908.68,-989.81,987.42),-1638.61))\r\n%%\r\nassert(isequal(celsius_to_franklin(652.08,797.79,-377.24,-59.91,-383.42),-65.06))\r\n%%\r\nassert(isequal(celsius_to_franklin(-965.37,-955.60,-397.18,361.85,-445.66),249.44))\r\n%%\r\nassert(isequal(celsius_to_franklin(47.99,766.77,932.43,-754.90,521.98),-48.72))\r\n%%\r\nassert(isequal(celsius_to_franklin(511.24,231.31,-85.92,-985.28,-611.87),-2056.79))\r\n%%\r\nassert(isequal(celsius_to_franklin(768.55,-217.35,-262.56,-220.12,515.30),-218.03))\r\n%%\r\nassert(isequal(celsius_to_franklin(-413.15,-952.69,133.75,-922.77,-505.69),-957.75))\r\n%%\r\nassert(isequal(celsius_to_franklin(188.47,610.83,837.90,81.43,134.78),654.60))\r\n%%\r\nassert(isequal(celsius_to_franklin(-574.69,934.83,-668.57,-702.77,408.89),18091.95))\r\n%%\r\nassert(isequal(celsius_to_franklin(-485.25,-858.09,-316.38,869.88,-25.16),3849.80))\r\n%%\r\nassert(isequal(celsius_to_franklin(-723.68,-261.45,-214.48,-33.00,-356.68),-96.80))\r\n%%\r\nassert(isequal(celsius_to_franklin(264.40,131.68,-304.40,-659.34,772.14),837.78))\r\n%%\r\nassert(isequal(celsius_to_franklin(-927.25,687.47,846.53,-842.40,758.80),-766.73))\r\n%%\r\nassert(isequal(celsius_to_franklin(-874.43,-518.50,179.50,46.43,232.70),74.95))\r\n%%\r\nassert(isequal(celsius_to_franklin(-541.26,-857.08,-142.04,-777.46,25.32),-744.08))\r\n%%\r\nassert(isequal(celsius_to_franklin(363.20,879.66,545.24,-99.49,-34.24),3017.40))\r\n%%\r\nassert(isequal(celsius_to_franklin(166.07,415.49,693.31,-912.26,-204.72),1349.25))\r\n%%\r\nassert(isequal(celsius_to_franklin(587.20,644.09,-450.02,764.92,143.15),695.82))\r\n%%\r\nassert(isequal(celsius_to_franklin(-881.13,477.87,733.74,533.48,346.53),520.15))\r\n%%\r\nassert(isequal(celsius_to_franklin(21.10,833.97,33.12,94.93,-522.20),34238.33))\r\n%%\r\nassert(isequal(celsius_to_franklin(129.18,-721.79,-176.17,715.01,589.38),-2887.22))\r\n%%\r\nassert(isequal(celsius_to_franklin(453.99,259.96,-596.74,279.21,-811.28),283.14))\r\n%%\r\nassert(isequal(celsius_to_franklin(369.37,958.33,-425.57,-338.45,769.98),1611.84))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":2,"created_by":255320,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":159,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-03-26T17:54:38.000Z","updated_at":"2026-03-31T14:18:46.000Z","published_at":"2020-03-26T17:54:38.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eTwo of the most famous temperature scales are the Celsius and the Fahrenheit scale. In reality, however, there are so many other temperature scales used in the chemical industry.\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\u003eLet's assume that all temperature conversions are of the form Y = AX + B where A and B are conversion constants, and X and Y are the temperature readings. If you are given two sample conversions from one scale to another, then you can convert any other value to and from that scale with this assumption. Take the Rankine scale for example. If we know that 476.85 degrees Celsius converts to 1350 degrees Rankine and 226.85 degrees Celsius converts to 900 degrees Rankine, then we can compute that 40 degrees Celsius is equal to 563.67 degrees Rankine.\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 a program that accepts 5 decimal numbers X1, Y1, X2, Y2, and T. Let’s name a new temperature scale 'Franklin'. If X1 degrees Celsius convert to Y1 degrees Franklin and X2 degrees Celsius convert to Y2 degrees Franklin, output a decimal number, rounded to 2 decimal places, denoting the degrees Franklin equivalent of T degrees Celsius. You are guaranteed that:\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\u003eAll inputs are in the range [-1000, 1000].\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\u003eEach test case is valid and has a unique solution.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":45391,"title":"Calculate the sphericity of a Raschig ring","description":"Sphericity is a measure of the roundness of any particle. It was defined by Wadell in 1935 as the ratio of the 'surface area of a sphere having the same volume as the given particle' to the 'surface area of the given particle'. By definition, the maximum value of sphericity is 1, which is that of a perfect sphere. The more elongated a particle is, the lesser its sphericity.\r\n\r\nA Raschig ring is a common particle found in packed beds that are shaped like small pieces of a tube (see figure). As a hollow cylinder, it has a height H, inner radius R1, and outer radius R2. The sphericity of a Raschig ring is important to calculate as it can influence the performance of a packed bed for adsorption. \r\n\r\n\u003c\u003chttps://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/RaschigRings005.JPG/296px-RaschigRings005.JPG\u003e\u003e \r\n \r\nMake a function that takes three values: H, R1, and R2. Output the sphericity of this hollow cylinder rounded to 4 decimal places. You are ensured that:\r\n\r\n* H, R1, and R2 are all positive integers\r\n* R1 \u003c R2\r\n* All inputs have consistent units; and \r\n* No input value exceeds 100. ","description_html":"\u003cp\u003eSphericity is a measure of the roundness of any particle. It was defined by Wadell in 1935 as the ratio of the 'surface area of a sphere having the same volume as the given particle' to the 'surface area of the given particle'. By definition, the maximum value of sphericity is 1, which is that of a perfect sphere. The more elongated a particle is, the lesser its sphericity.\u003c/p\u003e\u003cp\u003eA Raschig ring is a common particle found in packed beds that are shaped like small pieces of a tube (see figure). As a hollow cylinder, it has a height H, inner radius R1, and outer radius R2. The sphericity of a Raschig ring is important to calculate as it can influence the performance of a packed bed for adsorption.\u003c/p\u003e\u003cimg src = \"https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/RaschigRings005.JPG/296px-RaschigRings005.JPG\"\u003e\u003cp\u003eMake a function that takes three values: H, R1, and R2. Output the sphericity of this hollow cylinder rounded to 4 decimal places. You are ensured that:\u003c/p\u003e\u003cul\u003e\u003cli\u003eH, R1, and R2 are all positive integers\u003c/li\u003e\u003cli\u003eR1 \u0026lt; R2\u003c/li\u003e\u003cli\u003eAll inputs have consistent units; and\u003c/li\u003e\u003cli\u003eNo input value exceeds 100.\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = raschig_sphericity(H,R1,R2)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(raschig_sphericity(1,1,2),0.5724))\r\n%%\r\nassert(isequal(raschig_sphericity(8,6,7),0.3121))\r\n%%\r\nassert(isequal(raschig_sphericity(5,1,6),0.7379))\r\n%%\r\nassert(isequal(raschig_sphericity(63,42,80),0.5898))\r\n%%\r\nassert(isequal(raschig_sphericity(49,10,68),0.7246))\r\n%%\r\nassert(isequal(raschig_sphericity(96,48,80),0.5408))\r\n%%\r\nassert(isequal(raschig_sphericity(60,23,75),0.6827))\r\n%%\r\nassert(isequal(raschig_sphericity(16,77,82),0.2694))\r\n%%\r\nassert(isequal(raschig_sphericity(17,72,80),0.3272))\r\n%%\r\nassert(isequal(raschig_sphericity(17,62,72),0.3667))\r\n%%\r\nassert(isequal(raschig_sphericity(27,84,91),0.2859))\r\n%%\r\nassert(isequal(raschig_sphericity(11,20,50),0.4666))\r\n%%\r\nassert(isequal(raschig_sphericity(88,60,71),0.3213))\r\n%%\r\nassert(isequal(raschig_sphericity(36,88,99),0.3313))\r\n%%\r\nassert(isequal(raschig_sphericity(45,27,68),0.6329))\r\n%%\r\nassert(isequal(raschig_sphericity(18,86,90),0.2318))\r\n%%\r\nassert(isequal(raschig_sphericity(17,3,35),0.6679))\r\n%%\r\nassert(isequal(raschig_sphericity(56,82,97),0.3673))\r\n%%\r\nassert(isequal(raschig_sphericity(3,37,68),0.2113))\r\n%%\r\nassert(isequal(raschig_sphericity(47,5,64),0.7495))\r\n%%\r\nassert(isequal(raschig_sphericity(58,30,61),0.6098))\r\n%%\r\nassert(isequal(raschig_sphericity(14,30,84),0.4155))\r\n%%\r\nassert(isequal(raschig_sphericity(4,27,100),0.1877))\r\n%%\r\nassert(isequal(raschig_sphericity(45,16,91),0.6520))\r\n%%\r\nassert(isequal(raschig_sphericity(4,12,35),0.3453))\r\n%%\r\nassert(isequal(raschig_sphericity(76,89,92),0.1379))\r\n%%\r\nassert(isequal(raschig_sphericity(68,82,100),0.3876))\r\n%%\r\nassert(isequal(raschig_sphericity(88,39,97),0.6518))\r\n%%\r\nassert(isequal(raschig_sphericity(44,17,43),0.6590))\r\n%%\r\nassert(isequal(raschig_sphericity(69,93,100),0.2314))\r\n%%\r\nassert(isequal(raschig_sphericity(60,94,97),0.1451))\r\n%%\r\nassert(isequal(raschig_sphericity(5,30,33),0.3154))\r\n%%\r\nassert(isequal(raschig_sphericity(87,43,49),0.2549))\r\n%%\r\nassert(isequal(raschig_sphericity(14,24,41),0.5087))\r\n%%\r\nassert(isequal(raschig_sphericity(87,76,85),0.2686))\r\n%%\r\nassert(isequal(raschig_sphericity(39,59,81),0.4706))\r\n%%\r\nassert(isequal(raschig_sphericity(34,85,89),0.2058))\r\n%%\r\nassert(isequal(raschig_sphericity(94,39,81),0.6148))\r\n%%\r\nassert(isequal(raschig_sphericity(28,3,95),0.5608))\r\n%%\r\nassert(isequal(raschig_sphericity(54,67,88),0.4456))\r\n%%\r\nassert(isequal(raschig_sphericity(76,98,100),0.1034))\r\n%%\r\nassert(isequal(raschig_sphericity(86,99,100),0.0633))\r\n%%\r\nassert(isequal(raschig_sphericity(15,33,35),0.2297))\r\n%%\r\nassert(isequal(raschig_sphericity(70,95,99),0.1649))\r\n%%\r\nassert(isequal(raschig_sphericity(74,18,48),0.6685))\r\n%%\r\nassert(isequal(raschig_sphericity(58,46,92),0.5909))\r\n%%\r\nassert(isequal(raschig_sphericity(82,33,64),0.5923))\r\n%%\r\nassert(isequal(raschig_sphericity(68,59,65),0.2461))\r\n%%\r\nassert(isequal(raschig_sphericity(2,13,33),0.2450))\r\n%%\r\nassert(isequal(raschig_sphericity(45,53,100),0.5528))\r\n%%\r\nassert(isequal(raschig_sphericity(72,98,99),0.0673))\r\n%%\r\nassert(isequal(raschig_sphericity(64,96,98),0.1097))\r\n%%\r\nassert(isequal(raschig_sphericity(95,90,92),0.0993))\r\n%%\r\nassert(isequal(raschig_sphericity(74,18,27),0.4265))\r\n%%\r\nassert(isequal(raschig_sphericity(32,35,61),0.5499))\r\n%%\r\nassert(isequal(raschig_sphericity(29,32,81),0.5534))\r\n%%\r\nassert(isequal(raschig_sphericity(95,9,35),0.7062))\r\n%%\r\nassert(isequal(raschig_sphericity(60,83,97),0.3518))\r\n%%\r\nassert(isequal(raschig_sphericity(56,4,69),0.7725))\r\n%%\r\nassert(isequal(raschig_sphericity(85,7,41),0.7745))\r\n%%\r\nassert(isequal(raschig_sphericity(26,43,61),0.4810))\r\n%%\r\nassert(isequal(raschig_sphericity(97,13,32),0.6015))\r\n%%\r\nassert(isequal(raschig_sphericity(90,62,78),0.3825))\r\n%%\r\nassert(isequal(raschig_sphericity(36,65,91),0.4733))\r\n%%\r\nassert(isequal(raschig_sphericity(74,95,96),0.0674))\r\n%%\r\nassert(isequal(raschig_sphericity(43,1,71),0.7321))\r\n%%\r\nassert(isequal(raschig_sphericity(79,56,58),0.1229))\r\n%%\r\nassert(isequal(raschig_sphericity(1,98,99),0.1419))\r\n%%\r\nassert(isequal(raschig_sphericity(83,36,66),0.5745))\r\n%%\r\nassert(isequal(raschig_sphericity(12,78,88),0.3322))\r\n%%\r\nassert(isequal(raschig_sphericity(30,36,67),0.5501))\r\n%%\r\nassert(isequal(raschig_sphericity(44,70,91),0.4429))\r\n%%\r\nassert(isequal(raschig_sphericity(1,8,51),0.1183))\r\n%%\r\nassert(isequal(raschig_sphericity(78,81,93),0.3144))\r\n%%\r\nassert(isequal(raschig_sphericity(37,88,92),0.1995))\r\n%%\r\nassert(isequal(raschig_sphericity(7,72,94),0.2976))\r\n%%\r\nassert(isequal(raschig_sphericity(90,76,99),0.4243))\r\n%%\r\nassert(isequal(raschig_sphericity(54,96,100),0.1764))\r\n%%\r\nassert(isequal(raschig_sphericity(53,84,99),0.3670))\r\n%%\r\nassert(isequal(raschig_sphericity(94,46,87),0.5889))\r\n%%\r\nassert(isequal(raschig_sphericity(94,81,99),0.3707))\r\n%%\r\nassert(isequal(raschig_sphericity(45,83,100),0.3923))\r\n%%\r\nassert(isequal(raschig_sphericity(37,17,86),0.6207))\r\n%%\r\nassert(isequal(raschig_sphericity(59,96,98),0.1125))\r\n%%\r\nassert(isequal(raschig_sphericity(26,68,98),0.4545))\r\n%%\r\nassert(isequal(raschig_sphericity(62,32,66),0.6133))\r\n%%\r\nassert(isequal(raschig_sphericity(41,9,63),0.7096))\r\n%%\r\nassert(isequal(raschig_sphericity(88,55,69),0.3730))\r\n%%\r\nassert(isequal(raschig_sphericity(90,79,96),0.3663))\r\n%%\r\nassert(isequal(raschig_sphericity(60,56,70),0.3962))\r\n%%\r\nassert(isequal(raschig_sphericity(55,99,100),0.0730))\r\n%%\r\nassert(isequal(raschig_sphericity(69,48,87),0.5765))\r\n%%\r\nassert(isequal(raschig_sphericity(22,25,33),0.4465))\r\n%%\r\nassert(isequal(raschig_sphericity(71,85,97),0.3154))\r\n%%\r\nassert(isequal(raschig_sphericity(75,11,58),0.7642))\r\n%%\r\nassert(isequal(raschig_sphericity(85,84,91),0.2270))\r\n%%\r\nassert(isequal(raschig_sphericity(28,13,74),0.5982))\r\n%%\r\nassert(isequal(raschig_sphericity(56,1,43),0.8440))\r\n%%\r\nassert(isequal(raschig_sphericity(44,78,97),0.4158))\r\n%%\r\nassert(isequal(raschig_sphericity(59,15,66),0.7230))\r\n%%\r\nassert(isequal(raschig_sphericity(73,43,56),0.4007))\r\n%%\r\nassert(isequal(raschig_sphericity(27,99,100),0.0909))\r\n%%\r\nassert(isequal(raschig_sphericity(83,60,93),0.5209))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":4,"created_by":255320,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":98,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-03-26T17:26:21.000Z","updated_at":"2026-03-18T09:57:55.000Z","published_at":"2020-03-26T17:26: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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.JPEG\"}],\"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\u003eSphericity is a measure of the roundness of any particle. It was defined by Wadell in 1935 as the ratio of the 'surface area of a sphere having the same volume as the given particle' to the 'surface area of the given particle'. By definition, the maximum value of sphericity is 1, which is that of a perfect sphere. The more elongated a particle is, the lesser its sphericity.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA Raschig ring is a common particle found in packed beds that are shaped like small pieces of a tube (see figure). As a hollow cylinder, it has a height H, inner radius R1, and outer radius R2. The sphericity of a Raschig ring is important to calculate as it can influence the performance of a packed bed for adsorption.\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\u003eMake a function that takes three values: H, R1, and R2. Output the sphericity of this hollow cylinder rounded to 4 decimal places. You are ensured that:\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\u003eH, R1, and R2 are all positive integers\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\u003eR1 \u0026lt; R2\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\u003eAll inputs have consistent units; and\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\u003eNo input value exceeds 100.\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.JPEG\",\"contentType\":\"image/JPEG\",\"content\":\"data:image/JPEG;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCADwASgDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3w0UZorkKCik70tIAooo+lPcAooooAWikpc00wENFIaKhvUBc0UlFFwFzRSUtO4BRRSUXAdRSA0uapMAFFJml+tWhBS0lFO4C0UUVSYC0UCiqEFFFFMAooooAKKKKACiiigAooopgR9KM0lL2rhuWFFJnijNF7gLS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/GpdPvpdLvFuIvmwMOh6OvcH+nvUl7aTWcpWZCqn7j9Vb6Gq2PxrTRoLWPavCerQmSO3Yl4p1DQsMk4YcL/n3Fd8GUJkcjr9K8T8LCRNJtGkdWjKMEAOGUBsD/wDX7161pl089hESwJ2gHqSfQ/WvOqR5WdC1RfLM5KAZLdB/jV23t1ijwACT1amW0Gwbjy56mrir3PWtacLasxqT6IAvT2p/0pMYp1dMYmAUUCitFsIKMUUUwClpKWmgCij1opgFFFFHqAlFFFZAIRmkIFOooGRGMHFNMS9DnHWpsUUh3K5iBOce3TpTTGB25qwVHakK9hQBXK5HqaQpkcd6n2jv6Ubc9xn6UDuVDHz7Unl7jyePQirYjHtSbBxmgCtsPIIo8rj0qzt9KCMj27UXAqGLnAGPeomhyOnFXincCmlR2xg0gMx7cEngfSoHs+DngVsFOO1RPF7VVwMJ7M5GB9OKhNkS3IreaIEZpnkd+1IZyl74Wtr6J8Iquw4JTKn6juK5C9+H/wBnYu+mFk7tA7bfyHT8q9dEKqRmraR5UcYPr0rOSV9ClKx49BZXIWKC1s5jsG1V8lh36V6hounNaWqeaMSYGF67a1hGR3Jz709V2/8A6qyVPUcql0KoHtinelAp2K2ijJsO1FFFaokMUUdqMZFMA7UUCimAUfypaSmAtHakzRRcBaKKKe4CUUUVDAKKKKQxP50tFJikwFpuOtOpOtADdvelxgUo9aWkA3FJjinEUmKAG7SRjOKMA8Yp1BoGM29u1IV9z0qTFJikBFsyTkY/Gm7QWwBx61MV4OO9G0elGoXK5QYz2oKZxjtVjaCOlJtwOKVh3IhGM9PyqUKBjHFLjHHNKBikIUdKKWlqlEQUdqKKpAAozRRTEFFFFABRRR3qgCig0UAFFFFABRRRTA//2Q==\"}]}"},{"id":45411,"title":"Compute the missing quantity among P, V, T for an ideal gas","description":"Consider 100 mol of helium gas at a certain pressure (P), volume (V), and temperature (T). Assuming that the ideal gas law applies, can you compute one of the 3 quantities given the other two?\r\n\r\nRecall that, with SI units, the ideal gas law is given by:\r\n\r\n  P x V = n x R x T\r\n    where:\r\n    P = pressure [Pa] or [kg/m/s^2]\r\n    V = volume [m^3]\r\n    n = number of moles [mol]\r\n    R = gas constant, 8.314 [J/mol/K] or [kg.m^2/K/mol/s^2]\r\n    T = temperature [K]\r\n\r\nWrite a function that takes a MATLAB variable, x, which is always a 3-element row vector containing the values of P, V, T in that order. However, exactly one of these values will be NaN, which you must solve using the ideal gas law equation above, given the other two values. All inputs are given in SI units, hence, you can use the given value of |R| above. Note that |n| = 100 mol. You are ensured that P, V, and/or T are floating-point numbers with 2 decimal places that satisfy the following constraints:\r\n\r\n* 1 x 10^5 \u003c= P \u003c= 3 x 10^5\r\n* 1 \u003c= V \u003c= 10\r\n* 300 \u003c= T \u003c= 500\r\n\r\nOutput the value of the missing quantity rounded to 2 decimal places, followed by a space, and then the correct units, either |Pa|, |m^3|, or |K|. For this, you can use |sprintf|. See sample test cases:\r\n\r\n  \u003e\u003e idealgas([233424.06 NaN 435.02])\r\nans =\r\n    '1.55 m^3'\r\n\u003e\u003e idealgas([109238.31 2.76 NaN])\r\nans =\r\n    '362.64 K'\r\n\u003e\u003e idealgas([NaN 1.19 411.97])\r\nans =\r\n    '287825.09 Pa'\r\n","description_html":"\u003cp\u003eConsider 100 mol of helium gas at a certain pressure (P), volume (V), and temperature (T). Assuming that the ideal gas law applies, can you compute one of the 3 quantities given the other two?\u003c/p\u003e\u003cp\u003eRecall that, with SI units, the ideal gas law is given by:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eP x V = n x R x T\r\n  where:\r\n  P = pressure [Pa] or [kg/m/s^2]\r\n  V = volume [m^3]\r\n  n = number of moles [mol]\r\n  R = gas constant, 8.314 [J/mol/K] or [kg.m^2/K/mol/s^2]\r\n  T = temperature [K]\r\n\u003c/pre\u003e\u003cp\u003eWrite a function that takes a MATLAB variable, x, which is always a 3-element row vector containing the values of P, V, T in that order. However, exactly one of these values will be NaN, which you must solve using the ideal gas law equation above, given the other two values. All inputs are given in SI units, hence, you can use the given value of \u003ctt\u003eR\u003c/tt\u003e above. Note that \u003ctt\u003en\u003c/tt\u003e = 100 mol. You are ensured that P, V, and/or T are floating-point numbers with 2 decimal places that satisfy the following constraints:\u003c/p\u003e\u003cul\u003e\u003cli\u003e1 x 10^5 \u0026lt;= P \u0026lt;= 3 x 10^5\u003c/li\u003e\u003cli\u003e1 \u0026lt;= V \u0026lt;= 10\u003c/li\u003e\u003cli\u003e300 \u0026lt;= T \u0026lt;= 500\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eOutput the value of the missing quantity rounded to 2 decimal places, followed by a space, and then the correct units, either \u003ctt\u003ePa\u003c/tt\u003e, \u003ctt\u003em^3\u003c/tt\u003e, or \u003ctt\u003eK\u003c/tt\u003e. For this, you can use \u003ctt\u003esprintf\u003c/tt\u003e. See sample test cases:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e\u0026gt;\u0026gt; idealgas([233424.06 NaN 435.02])\r\nans =\r\n  '1.55 m^3'\r\n\u0026gt;\u0026gt; idealgas([109238.31 2.76 NaN])\r\nans =\r\n  '362.64 K'\r\n\u0026gt;\u0026gt; idealgas([NaN 1.19 411.97])\r\nans =\r\n  '287825.09 Pa'\r\n\u003c/pre\u003e","function_template":"function y = idealgas(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(idealgas([233424.06 NaN 435.02]),'1.55 m^3'))\r\n%%\r\nassert(isequal(idealgas([294119.71 NaN 317.25]),'0.90 m^3'))\r\n%%\r\nassert(isequal(idealgas([173530.58 2.85 NaN]),'594.85 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.49 410.36]),'75985.15 Pa'))\r\n%%\r\nassert(isequal(idealgas([228388.12 5.36 NaN]),'1472.41 K'))\r\n%%\r\nassert(isequal(idealgas([120121.26 NaN 347.47]),'2.40 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.65 320.97]),'57388.06 Pa'))\r\n%%\r\nassert(isequal(idealgas([256885.58 3.62 NaN]),'1118.51 K'))\r\n%%\r\nassert(isequal(idealgas([186497.00 NaN 451.62]),'2.01 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.99 486.75]),'203358.77 Pa'))\r\n%%\r\nassert(isequal(idealgas([153235.77 8.18 NaN]),'1507.66 K'))\r\n%%\r\nassert(isequal(idealgas([179201.35 3.46 NaN]),'745.77 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 5.07 421.97]),'69196.42 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.95 439.29]),'45940.34 Pa'))\r\n%%\r\nassert(isequal(idealgas([126030.29 NaN 301.56]),'1.99 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.51 406.24]),'44973.09 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.14 326.86]),'126986.64 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.51 339.25]),'112371.49 Pa'))\r\n%%\r\nassert(isequal(idealgas([163285.80 2.96 NaN]),'581.34 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 6.00 336.89]),'46681.72 Pa'))\r\n%%\r\nassert(isequal(idealgas([115469.36 NaN 441.34]),'3.18 m^3'))\r\n%%\r\nassert(isequal(idealgas([162685.80 2.50 NaN]),'489.19 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 3.32 379.36]),'94999.97 Pa'))\r\n%%\r\nassert(isequal(idealgas([236819.21 NaN 496.57]),'1.74 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.39 376.27]),'130891.58 Pa'))\r\n%%\r\nassert(isequal(idealgas([251622.49 8.84 NaN]),'2675.42 K'))\r\n%%\r\nassert(isequal(idealgas([158829.73 NaN 466.48]),'2.44 m^3'))\r\n%%\r\nassert(isequal(idealgas([167062.27 NaN 390.52]),'1.94 m^3'))\r\n%%\r\nassert(isequal(idealgas([171921.26 NaN 448.51]),'2.17 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.12 304.89]),'119568.65 Pa'))\r\n%%\r\nassert(isequal(idealgas([163504.12 6.88 NaN]),'1353.03 K'))\r\n%%\r\nassert(isequal(idealgas([191577.27 3.16 NaN]),'728.15 K'))\r\n%%\r\nassert(isequal(idealgas([248129.61 7.69 NaN]),'2295.06 K'))\r\n%%\r\nassert(isequal(idealgas([192652.12 2.91 NaN]),'674.31 K'))\r\n%%\r\nassert(isequal(idealgas([135001.95 2.47 NaN]),'401.08 K'))\r\n%%\r\nassert(isequal(idealgas([203311.64 7.32 NaN]),'1790.04 K'))\r\n%%\r\nassert(isequal(idealgas([208176.82 7.12 NaN]),'1782.80 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.08 405.01]),'161887.17 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.59 383.02]),'69377.52 Pa'))\r\n%%\r\nassert(isequal(idealgas([151077.35 NaN 484.74]),'2.67 m^3'))\r\n%%\r\nassert(isequal(idealgas([286522.71 2.47 NaN]),'851.23 K'))\r\n%%\r\nassert(isequal(idealgas([215478.84 4.96 NaN]),'1285.51 K'))\r\n%%\r\nassert(isequal(idealgas([145733.90 1.58 NaN]),'276.95 K'))\r\n%%\r\nassert(isequal(idealgas([243042.50 NaN 383.81]),'1.31 m^3'))\r\n%%\r\nassert(isequal(idealgas([263228.02 3.86 NaN]),'1222.11 K'))\r\n%%\r\nassert(isequal(idealgas([270452.78 5.55 NaN]),'1805.40 K'))\r\n%%\r\nassert(isequal(idealgas([188792.83 NaN 473.35]),'2.08 m^3'))\r\n%%\r\nassert(isequal(idealgas([171014.73 NaN 344.83]),'1.68 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.49 328.44]),'60816.26 Pa'))\r\n%%\r\nassert(isequal(idealgas([184222.45 NaN 445.16]),'2.01 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.61 414.21]),'45252.85 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 3.39 484.92]),'118926.99 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.79 428.02]),'198802.14 Pa'))\r\n%%\r\nassert(isequal(idealgas([109010.22 NaN 369.49]),'2.82 m^3'))\r\n%%\r\nassert(isequal(idealgas([176773.72 6.65 NaN]),'1413.93 K'))\r\n%%\r\nassert(isequal(idealgas([260111.73 NaN 462.62]),'1.48 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 6.18 406.01]),'54620.83 Pa'))\r\n%%\r\nassert(isequal(idealgas([149725.79 5.06 NaN]),'911.25 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.27 407.13]),'266525.89 Pa'))\r\n%%\r\nassert(isequal(idealgas([260418.29 9.90 NaN]),'3100.96 K'))\r\n%%\r\nassert(isequal(idealgas([103635.51 NaN 456.75]),'3.66 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 9.09 425.19]),'38889.22 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.64 308.36]),'97110.04 Pa'))\r\n%%\r\nassert(isequal(idealgas([223288.70 NaN 370.89]),'1.38 m^3'))\r\n%%\r\nassert(isequal(idealgas([296869.88 9.51 NaN]),'3395.76 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.03 432.48]),'89221.80 Pa'))\r\n%%\r\nassert(isequal(idealgas([159101.45 NaN 405.57]),'2.12 m^3'))\r\n%%\r\nassert(isequal(idealgas([220527.64 NaN 416.71]),'1.57 m^3'))\r\n%%\r\nassert(isequal(idealgas([216714.12 5.61 NaN]),'1462.31 K'))\r\n%%\r\nassert(isequal(idealgas([299231.22 NaN 494.25]),'1.37 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 5.09 382.69]),'62508.54 Pa'))\r\n%%\r\nassert(isequal(idealgas([125130.92 3.78 NaN]),'568.91 K'))\r\n%%\r\nassert(isequal(idealgas([238757.52 1.09 NaN]),'313.02 K'))\r\n%%\r\nassert(isequal(idealgas([254190.84 1.38 NaN]),'421.92 K'))\r\n%%\r\nassert(isequal(idealgas([245902.61 3.02 NaN]),'893.22 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 6.61 347.29]),'43681.83 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.90 486.90]),'51241.60 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.89 397.95]),'175055.89 Pa'))\r\n%%\r\nassert(isequal(idealgas([279178.31 NaN 308.83]),'0.92 m^3'))\r\n%%\r\nassert(isequal(idealgas([254499.01 NaN 335.80]),'1.10 m^3'))\r\n%%\r\nassert(isequal(idealgas([142029.13 NaN 481.27]),'2.82 m^3'))\r\n%%\r\nassert(isequal(idealgas([120306.78 NaN 310.92]),'2.15 m^3'))\r\n%%\r\nassert(isequal(idealgas([186344.23 NaN 462.32]),'2.06 m^3'))\r\n%%\r\nassert(isequal(idealgas([278889.55 2.24 NaN]),'751.40 K'))\r\n%%\r\nassert(isequal(idealgas([283498.77 NaN 423.67]),'1.24 m^3'))\r\n%%\r\nassert(isequal(idealgas([287205.47 NaN 446.12]),'1.29 m^3'))\r\n%%\r\nassert(isequal(idealgas([266630.40 4.58 NaN]),'1468.81 K'))\r\n%%\r\nassert(isequal(idealgas([164492.08 NaN 495.83]),'2.51 m^3'))\r\n%%\r\nassert(isequal(idealgas([166084.72 6.58 NaN]),'1314.45 K'))\r\n%%\r\nassert(isequal(idealgas([182780.15 5.43 NaN]),'1193.76 K'))\r\n%%\r\nassert(isequal(idealgas([165550.99 8.54 NaN]),'1700.51 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.21 432.53]),'85416.97 Pa'))\r\n%%\r\nassert(isequal(idealgas([146076.61 NaN 424.91]),'2.42 m^3'))\r\n%%\r\nassert(isequal(idealgas([232087.59 NaN 369.76]),'1.32 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.44 471.24]),'52659.80 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.24 467.34]),'173458.25 Pa'))\r\n%%\r\nassert(isequal(idealgas([217641.88 NaN 461.35]),'1.76 m^3'))\r\n%%\r\nassert(isequal(idealgas([197918.87 NaN 370.63]),'1.56 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.38 494.59]),'297972.56 Pa'))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":0,"created_by":255320,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":190,"test_suite_updated_at":"2020-03-31T14:35:13.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-03-31T13:58:54.000Z","updated_at":"2026-04-09T21:32:56.000Z","published_at":"2020-03-31T14:35:13.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 100 mol of helium gas at a certain pressure (P), volume (V), and temperature (T). Assuming that the ideal gas law applies, can you compute one of the 3 quantities given the other two?\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\u003eRecall that, with SI units, the ideal gas law 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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[P x V = n x R x T\\n  where:\\n  P = pressure [Pa] or [kg/m/s^2]\\n  V = volume [m^3]\\n  n = number of moles [mol]\\n  R = gas constant, 8.314 [J/mol/K] or [kg.m^2/K/mol/s^2]\\n  T = temperature [K]]]\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\u003eWrite a function that takes a MATLAB variable, x, which is always a 3-element row vector containing the values of P, V, T in that order. However, exactly one of these values will be NaN, which you must solve using the ideal gas law equation above, given the other two values. All inputs are given in SI units, hence, you can use the given value of\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eR\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e above. Note that\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 100 mol. You are ensured that P, V, and/or T are floating-point numbers with 2 decimal places that satisfy the following constraints:\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\u003e1 x 10^5 \u0026lt;= P \u0026lt;= 3 x 10^5\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\u003e1 \u0026lt;= V \u0026lt;= 10\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\u003e300 \u0026lt;= T \u0026lt;= 500\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 the value of the missing quantity rounded to 2 decimal places, followed by a space, and then the correct units, either\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePa\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:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em^3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. For this, you can use\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esprintf\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. See sample test cases:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[\u003e\u003e idealgas([233424.06 NaN 435.02])\\nans =\\n  '1.55 m^3'\\n\u003e\u003e idealgas([109238.31 2.76 NaN])\\nans =\\n  '362.64 K'\\n\u003e\u003e idealgas([NaN 1.19 411.97])\\nans =\\n  '287825.09 Pa']]\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":46736,"title":"Round to Nearest Multiple of 10^n","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 102px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 148px 51px; transform-origin: 148px 51px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 125px 21px; text-align: left; transform-origin: 125px 21px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eRound the given number , x to nearest multiple of 10^n\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: 125px 10.5px; text-align: left; transform-origin: 125px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eexample x = 8137, n= 2, then y =8100\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: 125px 10.5px; text-align: left; transform-origin: 125px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = round_10_n(x,n)\r\n  y = x*n;\r\nend","test_suite":"%%\r\nx = 8137;\r\nn=2;\r\ny_correct = 8100;\r\nassert(isequal(round_10_n(x,n),y_correct))\r\n\r\n%%\r\nx=45321;\r\nn=3;\r\ny_correct = 45000;\r\nassert(isequal(round_10_n(x,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":144669,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":86,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-12T23:44:34.000Z","updated_at":"2026-02-26T12:03:45.000Z","published_at":"2020-10-12T23:44:34.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\u003eRound the given number , x to nearest multiple of 10^n\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eexample x = 8137, n= 2, then y =8100\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44228,"title":"Who have the chance?","description":"Obtain a free 10 score in cody, if you have a chance don't change anything if you want to try or do what you can do to gain for the first time.\r\n in this function must the output be the same as in test to win.\r\n\r\nLet me see you guys!!","description_html":"\u003cp\u003eObtain a free 10 score in cody, if you have a chance don't change anything if you want to try or do what you can do to gain for the first time.\r\n in this function must the output be the same as in test to win.\u003c/p\u003e\u003cp\u003eLet me see you guys!!\u003c/p\u003e","function_template":"function y = your_chance()\r\n  y = round(rand(1,3));\r\nend","test_suite":"%%\r\nfiletext = fileread('your_chance.m'); \r\n%%\r\nassert(isequal(your_chance(),round(rand(1,3))))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":37163,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":38,"test_suite_updated_at":"2017-06-03T01:48:34.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-05-29T17:27:55.000Z","updated_at":"2026-02-20T14:06:56.000Z","published_at":"2017-05-29T17:27: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\u003eObtain a free 10 score in cody, if you have a chance don't change anything if you want to try or do what you can do to gain for the first time. in this function must the output be the same as in test to win.\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\u003eLet me see you guys!!\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":43148,"title":"Basic commands - rounding","description":"make a function which will round to integer, which is nearer to zero.\r\n\r\nExample \r\n\r\n  x=[-2.5 2];\r\n  y=[-2 2];","description_html":"\u003cp\u003emake a function which will round to integer, which is nearer to zero.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex=[-2.5 2];\r\ny=[-2 2];\r\n\u003c/pre\u003e","function_template":"function y = round20(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [-2.5 2.5];\r\ny_correct = [-2 2];\r\nassert(isequal(round20(x),y_correct))\r\n\r\n%%\r\nx = [-8.3 0.01 7.9];\r\ny_correct = [-8 0 7];\r\nassert(isequal(round20(x),y_correct))","published":true,"deleted":false,"likes_count":25,"comments_count":0,"created_by":90955,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":226,"test_suite_updated_at":"2016-10-07T11:28:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-07T11:28:01.000Z","updated_at":"2026-02-18T10:15:58.000Z","published_at":"2016-10-07T11:28:01.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003emake a function which will round to integer, which is nearer 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=[-2.5 2];\\ny=[-2 2];]]\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":45392,"title":"Convert a temperature reading from Celsius to an unknown scale","description":"Two of the most famous temperature scales are the Celsius and the Fahrenheit scale. In reality, however, there are so many other temperature scales used in the chemical industry. \r\n \r\nLet's assume that all temperature conversions are of the form Y = AX + B where A and B are conversion constants, and X and Y are the temperature readings. If you are given two sample conversions from one scale to another, then you can convert any other value to and from that scale with this assumption. Take the Rankine scale for example. If we know that 476.85 degrees Celsius converts to 1350 degrees Rankine and 226.85 degrees Celsius converts to 900 degrees Rankine, then we can compute that 40 degrees Celsius is equal to 563.67 degrees Rankine.\r\n \r\nMake a program that accepts 5 decimal numbers X1, Y1, X2, Y2, and T. Let’s name a new temperature scale 'Franklin'. If X1 degrees Celsius convert to Y1 degrees Franklin and X2 degrees Celsius convert to Y2 degrees Franklin, output a decimal number, rounded to 2 decimal places, denoting the degrees Franklin equivalent of T degrees Celsius. You are guaranteed that:\r\n\r\n* All inputs are in the range [-1000, 1000].\r\n* Each test case is valid and has a unique solution.\r\n","description_html":"\u003cp\u003eTwo of the most famous temperature scales are the Celsius and the Fahrenheit scale. In reality, however, there are so many other temperature scales used in the chemical industry.\u003c/p\u003e\u003cp\u003eLet's assume that all temperature conversions are of the form Y = AX + B where A and B are conversion constants, and X and Y are the temperature readings. If you are given two sample conversions from one scale to another, then you can convert any other value to and from that scale with this assumption. Take the Rankine scale for example. If we know that 476.85 degrees Celsius converts to 1350 degrees Rankine and 226.85 degrees Celsius converts to 900 degrees Rankine, then we can compute that 40 degrees Celsius is equal to 563.67 degrees Rankine.\u003c/p\u003e\u003cp\u003eMake a program that accepts 5 decimal numbers X1, Y1, X2, Y2, and T. Let’s name a new temperature scale 'Franklin'. If X1 degrees Celsius convert to Y1 degrees Franklin and X2 degrees Celsius convert to Y2 degrees Franklin, output a decimal number, rounded to 2 decimal places, denoting the degrees Franklin equivalent of T degrees Celsius. You are guaranteed that:\u003c/p\u003e\u003cul\u003e\u003cli\u003eAll inputs are in the range [-1000, 1000].\u003c/li\u003e\u003cli\u003eEach test case is valid and has a unique solution.\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = celsius_to_franklin(X1,Y1,X2,Y2,T)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(celsius_to_franklin(605.86,942.86,701.08,873.83,981.92),670.23))\r\n%%\r\nassert(isequal(celsius_to_franklin(-283.48,-820.99,34.93,-540.53,578.22),-61.99))\r\n%%\r\nassert(isequal(celsius_to_franklin(-642.38,-545.91,-236.27,259.69,641.57),2001.06))\r\n%%\r\nassert(isequal(celsius_to_franklin(-388.76,740.12,-355.52,996.42,156.00),4940.54))\r\n%%\r\nassert(isequal(celsius_to_franklin(-424.57,-136.40,-544.47,-598.13,-454.91),-253.24))\r\n%%\r\nassert(isequal(celsius_to_franklin(-943.67,428.22,-381.09,-96.63,823.88),-1220.79))\r\n%%\r\nassert(isequal(celsius_to_franklin(205.93,437.77,-539.18,6.82,-447.39),59.91))\r\n%%\r\nassert(isequal(celsius_to_franklin(863.18,284.69,-263.58,368.62,926.41),279.98))\r\n%%\r\nassert(isequal(celsius_to_franklin(-147.74,127.01,-672.12,-960.23,-492.42),-587.64))\r\n%%\r\nassert(isequal(celsius_to_franklin(-470.00,-330.01,245.92,32.44,368.50),94.50))\r\n%%\r\nassert(isequal(celsius_to_franklin(-953.62,-685.32,-111.79,461.55,-660.24),-285.63))\r\n%%\r\nassert(isequal(celsius_to_franklin(657.17,897.22,-335.17,803.76,-866.72),753.70))\r\n%%\r\nassert(isequal(celsius_to_franklin(584.48,-166.12,259.41,-70.18,555.04),-157.43))\r\n%%\r\nassert(isequal(celsius_to_franklin(-409.79,-416.75,-96.33,609.90,-841.00),-1829.06))\r\n%%\r\nassert(isequal(celsius_to_franklin(-307.20,-48.77,366.97,569.72,-590.24),-308.43))\r\n%%\r\nassert(isequal(celsius_to_franklin(-640.68,-365.85,-741.44,-757.17,-230.91),1225.57))\r\n%%\r\nassert(isequal(celsius_to_franklin(-132.47,214.18,-277.77,782.82,-612.67),2093.47))\r\n%%\r\nassert(isequal(celsius_to_franklin(-690.34,-308.03,216.70,-736.01,-355.91),-465.83))\r\n%%\r\nassert(isequal(celsius_to_franklin(927.61,379.39,698.87,962.06,-538.43),4113.84))\r\n%%\r\nassert(isequal(celsius_to_franklin(-886.01,-463.51,756.77,803.12,87.47),287.07))\r\n%%\r\nassert(isequal(celsius_to_franklin(-502.42,-588.56,-206.72,-98.65,321.02),775.70))\r\n%%\r\nassert(isequal(celsius_to_franklin(-153.74,7.78,-682.05,-719.25,120.16),384.71))\r\n%%\r\nassert(isequal(celsius_to_franklin(-144.83,-134.94,-189.12,-37.86,-515.74),678.06))\r\n%%\r\nassert(isequal(celsius_to_franklin(-995.20,151.44,-741.17,-470.43,-406.85),-1288.85))\r\n%%\r\nassert(isequal(celsius_to_franklin(871.26,-14.30,236.99,-926.20,-443.03),-1903.88))\r\n%%\r\nassert(isequal(celsius_to_franklin(715.15,782.47,47.57,-466.79,44.72),-472.12))\r\n%%\r\nassert(isequal(celsius_to_franklin(899.12,-837.45,-191.19,-256.33,-293.28),-201.92))\r\n%%\r\nassert(isequal(celsius_to_franklin(-202.59,-537.15,-192.74,407.01,299.90),47628.43))\r\n%%\r\nassert(isequal(celsius_to_franklin(913.66,334.21,33.59,-112.18,-55.21),-157.22))\r\n%%\r\nassert(isequal(celsius_to_franklin(955.44,756.25,-738.91,-848.13,114.84),-39.71))\r\n%%\r\nassert(isequal(celsius_to_franklin(-666.83,-718.81,55.93,-298.83,-586.09),-671.89))\r\n%%\r\nassert(isequal(celsius_to_franklin(147.36,-107.49,37.96,373.14,543.46),-1847.69))\r\n%%\r\nassert(isequal(celsius_to_franklin(-187.90,-485.31,-936.87,953.10,-349.60),-174.76))\r\n%%\r\nassert(isequal(celsius_to_franklin(-341.01,93.29,-190.04,507.03,-51.48),886.76))\r\n%%\r\nassert(isequal(celsius_to_franklin(584.80,435.13,-16.48,-899.54,29.33),-797.85))\r\n%%\r\nassert(isequal(celsius_to_franklin(-340.40,903.99,-371.65,-204.97,884.36),44366.71))\r\n%%\r\nassert(isequal(celsius_to_franklin(-781.65,-583.60,127.07,910.74,-822.91),-651.45))\r\n%%\r\nassert(isequal(celsius_to_franklin(-386.75,-935.79,531.29,-280.34,-408.39),-951.24))\r\n%%\r\nassert(isequal(celsius_to_franklin(161.90,440.48,-210.43,-49.91,269.72),582.49))\r\n%%\r\nassert(isequal(celsius_to_franklin(-748.00,558.83,611.62,-70.60,-33.59),228.10))\r\n%%\r\nassert(isequal(celsius_to_franklin(657.96,-975.96,777.84,21.10,-407.55),-9837.97))\r\n%%\r\nassert(isequal(celsius_to_franklin(-230.46,-919.89,-284.33,499.32,-234.82),-805.03))\r\n%%\r\nassert(isequal(celsius_to_franklin(-301.12,-825.93,814.58,-552.94,507.82),-628.00))\r\n%%\r\nassert(isequal(celsius_to_franklin(697.75,701.18,10.89,34.27,653.33),658.05))\r\n%%\r\nassert(isequal(celsius_to_franklin(280.00,888.78,-786.06,403.46,708.18),1083.71))\r\n%%\r\nassert(isequal(celsius_to_franklin(-10.67,543.28,264.36,637.92,894.65),854.81))\r\n%%\r\nassert(isequal(celsius_to_franklin(-206.85,153.56,-128.64,-453.56,89.79),-2149.16))\r\n%%\r\nassert(isequal(celsius_to_franklin(-76.51,-747.71,305.05,982.05,-576.62),-3014.90))\r\n%%\r\nassert(isequal(celsius_to_franklin(292.10,-573.74,-958.20,-149.66,113.10),-513.03))\r\n%%\r\nassert(isequal(celsius_to_franklin(792.56,-79.19,-775.41,-838.95,-698.15),-801.51))\r\n%%\r\nassert(isequal(celsius_to_franklin(-396.81,922.69,629.52,-216.29,678.00),-270.09))\r\n%%\r\nassert(isequal(celsius_to_franklin(-517.35,852.83,-16.57,-944.12,849.97),-4053.53))\r\n%%\r\nassert(isequal(celsius_to_franklin(-434.10,504.36,-908.25,-132.70,317.96),1514.82))\r\n%%\r\nassert(isequal(celsius_to_franklin(829.18,913.01,168.51,348.27,731.39),829.42))\r\n%%\r\nassert(isequal(celsius_to_franklin(-333.40,-166.89,-456.37,639.93,-427.43),450.05))\r\n%%\r\nassert(isequal(celsius_to_franklin(-294.90,-60.17,550.47,304.60,671.10),356.65))\r\n%%\r\nassert(isequal(celsius_to_franklin(485.15,789.20,766.49,210.31,465.73),829.16))\r\n%%\r\nassert(isequal(celsius_to_franklin(203.09,-17.32,914.47,-533.31,-199.58),274.75))\r\n%%\r\nassert(isequal(celsius_to_franklin(966.57,445.31,-794.28,-130.59,-831.11),-142.64))\r\n%%\r\nassert(isequal(celsius_to_franklin(-738.77,-731.47,-714.39,984.04,-269.54),32286.12))\r\n%%\r\nassert(isequal(celsius_to_franklin(930.51,64.10,-449.17,775.23,87.89),498.41))\r\n%%\r\nassert(isequal(celsius_to_franklin(-868.15,640.06,347.72,-454.46,17.03),-156.77))\r\n%%\r\nassert(isequal(celsius_to_franklin(-937.82,569.83,-404.13,866.50,-171.47),995.83))\r\n%%\r\nassert(isequal(celsius_to_franklin(-169.08,901.62,-131.93,-661.45,-597.44),18924.68))\r\n%%\r\nassert(isequal(celsius_to_franklin(-189.62,-713.35,-270.02,-220.67,637.73),-5783.24))\r\n%%\r\nassert(isequal(celsius_to_franklin(492.42,-319.45,141.79,288.15,113.21),337.68))\r\n%%\r\nassert(isequal(celsius_to_franklin(283.90,-538.88,-437.08,918.34,-115.93),269.24))\r\n%%\r\nassert(isequal(celsius_to_franklin(-306.06,561.45,469.95,418.77,357.52),439.44))\r\n%%\r\nassert(isequal(celsius_to_franklin(-750.15,755.17,-347.75,-855.09,549.57),-4445.84))\r\n%%\r\nassert(isequal(celsius_to_franklin(-522.01,440.91,261.38,-459.71,195.94),-384.48))\r\n%%\r\nassert(isequal(celsius_to_franklin(741.61,107.09,454.92,-904.42,-603.83),-4639.94))\r\n%%\r\nassert(isequal(celsius_to_franklin(91.21,547.62,235.88,78.98,176.30),271.98))\r\n%%\r\nassert(isequal(celsius_to_franklin(970.32,-331.81,24.95,989.19,396.94),469.39))\r\n%%\r\nassert(isequal(celsius_to_franklin(573.18,-145.55,-501.14,406.38,-809.38),564.74))\r\n%%\r\nassert(isequal(celsius_to_franklin(674.12,182.10,-769.93,-438.99,216.83),-14.58))\r\n%%\r\nassert(isequal(celsius_to_franklin(-501.54,364.36,122.84,736.62,105.33),726.18))\r\n%%\r\nassert(isequal(celsius_to_franklin(423.69,-98.78,-153.62,-130.92,663.06),-85.45))\r\n%%\r\nassert(isequal(celsius_to_franklin(796.67,-66.87,908.68,-989.81,987.42),-1638.61))\r\n%%\r\nassert(isequal(celsius_to_franklin(652.08,797.79,-377.24,-59.91,-383.42),-65.06))\r\n%%\r\nassert(isequal(celsius_to_franklin(-965.37,-955.60,-397.18,361.85,-445.66),249.44))\r\n%%\r\nassert(isequal(celsius_to_franklin(47.99,766.77,932.43,-754.90,521.98),-48.72))\r\n%%\r\nassert(isequal(celsius_to_franklin(511.24,231.31,-85.92,-985.28,-611.87),-2056.79))\r\n%%\r\nassert(isequal(celsius_to_franklin(768.55,-217.35,-262.56,-220.12,515.30),-218.03))\r\n%%\r\nassert(isequal(celsius_to_franklin(-413.15,-952.69,133.75,-922.77,-505.69),-957.75))\r\n%%\r\nassert(isequal(celsius_to_franklin(188.47,610.83,837.90,81.43,134.78),654.60))\r\n%%\r\nassert(isequal(celsius_to_franklin(-574.69,934.83,-668.57,-702.77,408.89),18091.95))\r\n%%\r\nassert(isequal(celsius_to_franklin(-485.25,-858.09,-316.38,869.88,-25.16),3849.80))\r\n%%\r\nassert(isequal(celsius_to_franklin(-723.68,-261.45,-214.48,-33.00,-356.68),-96.80))\r\n%%\r\nassert(isequal(celsius_to_franklin(264.40,131.68,-304.40,-659.34,772.14),837.78))\r\n%%\r\nassert(isequal(celsius_to_franklin(-927.25,687.47,846.53,-842.40,758.80),-766.73))\r\n%%\r\nassert(isequal(celsius_to_franklin(-874.43,-518.50,179.50,46.43,232.70),74.95))\r\n%%\r\nassert(isequal(celsius_to_franklin(-541.26,-857.08,-142.04,-777.46,25.32),-744.08))\r\n%%\r\nassert(isequal(celsius_to_franklin(363.20,879.66,545.24,-99.49,-34.24),3017.40))\r\n%%\r\nassert(isequal(celsius_to_franklin(166.07,415.49,693.31,-912.26,-204.72),1349.25))\r\n%%\r\nassert(isequal(celsius_to_franklin(587.20,644.09,-450.02,764.92,143.15),695.82))\r\n%%\r\nassert(isequal(celsius_to_franklin(-881.13,477.87,733.74,533.48,346.53),520.15))\r\n%%\r\nassert(isequal(celsius_to_franklin(21.10,833.97,33.12,94.93,-522.20),34238.33))\r\n%%\r\nassert(isequal(celsius_to_franklin(129.18,-721.79,-176.17,715.01,589.38),-2887.22))\r\n%%\r\nassert(isequal(celsius_to_franklin(453.99,259.96,-596.74,279.21,-811.28),283.14))\r\n%%\r\nassert(isequal(celsius_to_franklin(369.37,958.33,-425.57,-338.45,769.98),1611.84))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":2,"created_by":255320,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":159,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-03-26T17:54:38.000Z","updated_at":"2026-03-31T14:18:46.000Z","published_at":"2020-03-26T17:54:38.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eTwo of the most famous temperature scales are the Celsius and the Fahrenheit scale. In reality, however, there are so many other temperature scales used in the chemical industry.\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\u003eLet's assume that all temperature conversions are of the form Y = AX + B where A and B are conversion constants, and X and Y are the temperature readings. If you are given two sample conversions from one scale to another, then you can convert any other value to and from that scale with this assumption. Take the Rankine scale for example. If we know that 476.85 degrees Celsius converts to 1350 degrees Rankine and 226.85 degrees Celsius converts to 900 degrees Rankine, then we can compute that 40 degrees Celsius is equal to 563.67 degrees Rankine.\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 a program that accepts 5 decimal numbers X1, Y1, X2, Y2, and T. Let’s name a new temperature scale 'Franklin'. If X1 degrees Celsius convert to Y1 degrees Franklin and X2 degrees Celsius convert to Y2 degrees Franklin, output a decimal number, rounded to 2 decimal places, denoting the degrees Franklin equivalent of T degrees Celsius. You are guaranteed that:\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\u003eAll inputs are in the range [-1000, 1000].\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\u003eEach test case is valid and has a unique solution.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"},{"id":45391,"title":"Calculate the sphericity of a Raschig ring","description":"Sphericity is a measure of the roundness of any particle. It was defined by Wadell in 1935 as the ratio of the 'surface area of a sphere having the same volume as the given particle' to the 'surface area of the given particle'. By definition, the maximum value of sphericity is 1, which is that of a perfect sphere. The more elongated a particle is, the lesser its sphericity.\r\n\r\nA Raschig ring is a common particle found in packed beds that are shaped like small pieces of a tube (see figure). As a hollow cylinder, it has a height H, inner radius R1, and outer radius R2. The sphericity of a Raschig ring is important to calculate as it can influence the performance of a packed bed for adsorption. \r\n\r\n\u003c\u003chttps://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/RaschigRings005.JPG/296px-RaschigRings005.JPG\u003e\u003e \r\n \r\nMake a function that takes three values: H, R1, and R2. Output the sphericity of this hollow cylinder rounded to 4 decimal places. You are ensured that:\r\n\r\n* H, R1, and R2 are all positive integers\r\n* R1 \u003c R2\r\n* All inputs have consistent units; and \r\n* No input value exceeds 100. ","description_html":"\u003cp\u003eSphericity is a measure of the roundness of any particle. It was defined by Wadell in 1935 as the ratio of the 'surface area of a sphere having the same volume as the given particle' to the 'surface area of the given particle'. By definition, the maximum value of sphericity is 1, which is that of a perfect sphere. The more elongated a particle is, the lesser its sphericity.\u003c/p\u003e\u003cp\u003eA Raschig ring is a common particle found in packed beds that are shaped like small pieces of a tube (see figure). As a hollow cylinder, it has a height H, inner radius R1, and outer radius R2. The sphericity of a Raschig ring is important to calculate as it can influence the performance of a packed bed for adsorption.\u003c/p\u003e\u003cimg src = \"https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/RaschigRings005.JPG/296px-RaschigRings005.JPG\"\u003e\u003cp\u003eMake a function that takes three values: H, R1, and R2. Output the sphericity of this hollow cylinder rounded to 4 decimal places. You are ensured that:\u003c/p\u003e\u003cul\u003e\u003cli\u003eH, R1, and R2 are all positive integers\u003c/li\u003e\u003cli\u003eR1 \u0026lt; R2\u003c/li\u003e\u003cli\u003eAll inputs have consistent units; and\u003c/li\u003e\u003cli\u003eNo input value exceeds 100.\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = raschig_sphericity(H,R1,R2)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(raschig_sphericity(1,1,2),0.5724))\r\n%%\r\nassert(isequal(raschig_sphericity(8,6,7),0.3121))\r\n%%\r\nassert(isequal(raschig_sphericity(5,1,6),0.7379))\r\n%%\r\nassert(isequal(raschig_sphericity(63,42,80),0.5898))\r\n%%\r\nassert(isequal(raschig_sphericity(49,10,68),0.7246))\r\n%%\r\nassert(isequal(raschig_sphericity(96,48,80),0.5408))\r\n%%\r\nassert(isequal(raschig_sphericity(60,23,75),0.6827))\r\n%%\r\nassert(isequal(raschig_sphericity(16,77,82),0.2694))\r\n%%\r\nassert(isequal(raschig_sphericity(17,72,80),0.3272))\r\n%%\r\nassert(isequal(raschig_sphericity(17,62,72),0.3667))\r\n%%\r\nassert(isequal(raschig_sphericity(27,84,91),0.2859))\r\n%%\r\nassert(isequal(raschig_sphericity(11,20,50),0.4666))\r\n%%\r\nassert(isequal(raschig_sphericity(88,60,71),0.3213))\r\n%%\r\nassert(isequal(raschig_sphericity(36,88,99),0.3313))\r\n%%\r\nassert(isequal(raschig_sphericity(45,27,68),0.6329))\r\n%%\r\nassert(isequal(raschig_sphericity(18,86,90),0.2318))\r\n%%\r\nassert(isequal(raschig_sphericity(17,3,35),0.6679))\r\n%%\r\nassert(isequal(raschig_sphericity(56,82,97),0.3673))\r\n%%\r\nassert(isequal(raschig_sphericity(3,37,68),0.2113))\r\n%%\r\nassert(isequal(raschig_sphericity(47,5,64),0.7495))\r\n%%\r\nassert(isequal(raschig_sphericity(58,30,61),0.6098))\r\n%%\r\nassert(isequal(raschig_sphericity(14,30,84),0.4155))\r\n%%\r\nassert(isequal(raschig_sphericity(4,27,100),0.1877))\r\n%%\r\nassert(isequal(raschig_sphericity(45,16,91),0.6520))\r\n%%\r\nassert(isequal(raschig_sphericity(4,12,35),0.3453))\r\n%%\r\nassert(isequal(raschig_sphericity(76,89,92),0.1379))\r\n%%\r\nassert(isequal(raschig_sphericity(68,82,100),0.3876))\r\n%%\r\nassert(isequal(raschig_sphericity(88,39,97),0.6518))\r\n%%\r\nassert(isequal(raschig_sphericity(44,17,43),0.6590))\r\n%%\r\nassert(isequal(raschig_sphericity(69,93,100),0.2314))\r\n%%\r\nassert(isequal(raschig_sphericity(60,94,97),0.1451))\r\n%%\r\nassert(isequal(raschig_sphericity(5,30,33),0.3154))\r\n%%\r\nassert(isequal(raschig_sphericity(87,43,49),0.2549))\r\n%%\r\nassert(isequal(raschig_sphericity(14,24,41),0.5087))\r\n%%\r\nassert(isequal(raschig_sphericity(87,76,85),0.2686))\r\n%%\r\nassert(isequal(raschig_sphericity(39,59,81),0.4706))\r\n%%\r\nassert(isequal(raschig_sphericity(34,85,89),0.2058))\r\n%%\r\nassert(isequal(raschig_sphericity(94,39,81),0.6148))\r\n%%\r\nassert(isequal(raschig_sphericity(28,3,95),0.5608))\r\n%%\r\nassert(isequal(raschig_sphericity(54,67,88),0.4456))\r\n%%\r\nassert(isequal(raschig_sphericity(76,98,100),0.1034))\r\n%%\r\nassert(isequal(raschig_sphericity(86,99,100),0.0633))\r\n%%\r\nassert(isequal(raschig_sphericity(15,33,35),0.2297))\r\n%%\r\nassert(isequal(raschig_sphericity(70,95,99),0.1649))\r\n%%\r\nassert(isequal(raschig_sphericity(74,18,48),0.6685))\r\n%%\r\nassert(isequal(raschig_sphericity(58,46,92),0.5909))\r\n%%\r\nassert(isequal(raschig_sphericity(82,33,64),0.5923))\r\n%%\r\nassert(isequal(raschig_sphericity(68,59,65),0.2461))\r\n%%\r\nassert(isequal(raschig_sphericity(2,13,33),0.2450))\r\n%%\r\nassert(isequal(raschig_sphericity(45,53,100),0.5528))\r\n%%\r\nassert(isequal(raschig_sphericity(72,98,99),0.0673))\r\n%%\r\nassert(isequal(raschig_sphericity(64,96,98),0.1097))\r\n%%\r\nassert(isequal(raschig_sphericity(95,90,92),0.0993))\r\n%%\r\nassert(isequal(raschig_sphericity(74,18,27),0.4265))\r\n%%\r\nassert(isequal(raschig_sphericity(32,35,61),0.5499))\r\n%%\r\nassert(isequal(raschig_sphericity(29,32,81),0.5534))\r\n%%\r\nassert(isequal(raschig_sphericity(95,9,35),0.7062))\r\n%%\r\nassert(isequal(raschig_sphericity(60,83,97),0.3518))\r\n%%\r\nassert(isequal(raschig_sphericity(56,4,69),0.7725))\r\n%%\r\nassert(isequal(raschig_sphericity(85,7,41),0.7745))\r\n%%\r\nassert(isequal(raschig_sphericity(26,43,61),0.4810))\r\n%%\r\nassert(isequal(raschig_sphericity(97,13,32),0.6015))\r\n%%\r\nassert(isequal(raschig_sphericity(90,62,78),0.3825))\r\n%%\r\nassert(isequal(raschig_sphericity(36,65,91),0.4733))\r\n%%\r\nassert(isequal(raschig_sphericity(74,95,96),0.0674))\r\n%%\r\nassert(isequal(raschig_sphericity(43,1,71),0.7321))\r\n%%\r\nassert(isequal(raschig_sphericity(79,56,58),0.1229))\r\n%%\r\nassert(isequal(raschig_sphericity(1,98,99),0.1419))\r\n%%\r\nassert(isequal(raschig_sphericity(83,36,66),0.5745))\r\n%%\r\nassert(isequal(raschig_sphericity(12,78,88),0.3322))\r\n%%\r\nassert(isequal(raschig_sphericity(30,36,67),0.5501))\r\n%%\r\nassert(isequal(raschig_sphericity(44,70,91),0.4429))\r\n%%\r\nassert(isequal(raschig_sphericity(1,8,51),0.1183))\r\n%%\r\nassert(isequal(raschig_sphericity(78,81,93),0.3144))\r\n%%\r\nassert(isequal(raschig_sphericity(37,88,92),0.1995))\r\n%%\r\nassert(isequal(raschig_sphericity(7,72,94),0.2976))\r\n%%\r\nassert(isequal(raschig_sphericity(90,76,99),0.4243))\r\n%%\r\nassert(isequal(raschig_sphericity(54,96,100),0.1764))\r\n%%\r\nassert(isequal(raschig_sphericity(53,84,99),0.3670))\r\n%%\r\nassert(isequal(raschig_sphericity(94,46,87),0.5889))\r\n%%\r\nassert(isequal(raschig_sphericity(94,81,99),0.3707))\r\n%%\r\nassert(isequal(raschig_sphericity(45,83,100),0.3923))\r\n%%\r\nassert(isequal(raschig_sphericity(37,17,86),0.6207))\r\n%%\r\nassert(isequal(raschig_sphericity(59,96,98),0.1125))\r\n%%\r\nassert(isequal(raschig_sphericity(26,68,98),0.4545))\r\n%%\r\nassert(isequal(raschig_sphericity(62,32,66),0.6133))\r\n%%\r\nassert(isequal(raschig_sphericity(41,9,63),0.7096))\r\n%%\r\nassert(isequal(raschig_sphericity(88,55,69),0.3730))\r\n%%\r\nassert(isequal(raschig_sphericity(90,79,96),0.3663))\r\n%%\r\nassert(isequal(raschig_sphericity(60,56,70),0.3962))\r\n%%\r\nassert(isequal(raschig_sphericity(55,99,100),0.0730))\r\n%%\r\nassert(isequal(raschig_sphericity(69,48,87),0.5765))\r\n%%\r\nassert(isequal(raschig_sphericity(22,25,33),0.4465))\r\n%%\r\nassert(isequal(raschig_sphericity(71,85,97),0.3154))\r\n%%\r\nassert(isequal(raschig_sphericity(75,11,58),0.7642))\r\n%%\r\nassert(isequal(raschig_sphericity(85,84,91),0.2270))\r\n%%\r\nassert(isequal(raschig_sphericity(28,13,74),0.5982))\r\n%%\r\nassert(isequal(raschig_sphericity(56,1,43),0.8440))\r\n%%\r\nassert(isequal(raschig_sphericity(44,78,97),0.4158))\r\n%%\r\nassert(isequal(raschig_sphericity(59,15,66),0.7230))\r\n%%\r\nassert(isequal(raschig_sphericity(73,43,56),0.4007))\r\n%%\r\nassert(isequal(raschig_sphericity(27,99,100),0.0909))\r\n%%\r\nassert(isequal(raschig_sphericity(83,60,93),0.5209))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":4,"created_by":255320,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":98,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-03-26T17:26:21.000Z","updated_at":"2026-03-18T09:57:55.000Z","published_at":"2020-03-26T17:26: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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.JPEG\"}],\"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\u003eSphericity is a measure of the roundness of any particle. It was defined by Wadell in 1935 as the ratio of the 'surface area of a sphere having the same volume as the given particle' to the 'surface area of the given particle'. By definition, the maximum value of sphericity is 1, which is that of a perfect sphere. The more elongated a particle is, the lesser its sphericity.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA Raschig ring is a common particle found in packed beds that are shaped like small pieces of a tube (see figure). As a hollow cylinder, it has a height H, inner radius R1, and outer radius R2. The sphericity of a Raschig ring is important to calculate as it can influence the performance of a packed bed for adsorption.\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\u003eMake a function that takes three values: H, R1, and R2. Output the sphericity of this hollow cylinder rounded to 4 decimal places. You are ensured that:\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\u003eH, R1, and R2 are all positive integers\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\u003eR1 \u0026lt; R2\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\u003eAll inputs have consistent units; and\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\u003eNo input value exceeds 100.\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.JPEG\",\"contentType\":\"image/JPEG\",\"content\":\"data:image/JPEG;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhM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sIKMUUUwClpKWmgCij1opgFFFFHqAlFFFZAIRmkIFOooGRGMHFNMS9DnHWpsUUh3K5iBOce3TpTTGB25qwVHakK9hQBXK5HqaQpkcd6n2jv6Ubc9xn6UDuVDHz7Unl7jyePQirYjHtSbBxmgCtsPIIo8rj0qzt9KCMj27UXAqGLnAGPeomhyOnFXincCmlR2xg0gMx7cEngfSoHs+DngVsFOO1RPF7VVwMJ7M5GB9OKhNkS3IreaIEZpnkd+1IZyl74Wtr6J8Iquw4JTKn6juK5C9+H/wBnYu+mFk7tA7bfyHT8q9dEKqRmraR5UcYPr0rOSV9ClKx49BZXIWKC1s5jsG1V8lh36V6hounNaWqeaMSYGF67a1hGR3Jz709V2/8A6qyVPUcql0KoHtinelAp2K2ijJsO1FFFaokMUUdqMZFMA7UUCimAUfypaSmAtHakzRRcBaKKKe4CUUUVDAKKKKQxP50tFJikwFpuOtOpOtADdvelxgUo9aWkA3FJjinEUmKAG7SRjOKMA8Yp1BoGM29u1IV9z0qTFJikBFsyTkY/Gm7QWwBx61MV4OO9G0elGoXK5QYz2oKZxjtVjaCOlJtwOKVh3IhGM9PyqUKBjHFLjHHNKBikIUdKKWlqlEQUdqKKpAAozRRTEFFFFABRRR3qgCig0UAFFFFABRRRTA//2Q==\"}]}"},{"id":45411,"title":"Compute the missing quantity among P, V, T for an ideal gas","description":"Consider 100 mol of helium gas at a certain pressure (P), volume (V), and temperature (T). Assuming that the ideal gas law applies, can you compute one of the 3 quantities given the other two?\r\n\r\nRecall that, with SI units, the ideal gas law is given by:\r\n\r\n  P x V = n x R x T\r\n    where:\r\n    P = pressure [Pa] or [kg/m/s^2]\r\n    V = volume [m^3]\r\n    n = number of moles [mol]\r\n    R = gas constant, 8.314 [J/mol/K] or [kg.m^2/K/mol/s^2]\r\n    T = temperature [K]\r\n\r\nWrite a function that takes a MATLAB variable, x, which is always a 3-element row vector containing the values of P, V, T in that order. However, exactly one of these values will be NaN, which you must solve using the ideal gas law equation above, given the other two values. All inputs are given in SI units, hence, you can use the given value of |R| above. Note that |n| = 100 mol. You are ensured that P, V, and/or T are floating-point numbers with 2 decimal places that satisfy the following constraints:\r\n\r\n* 1 x 10^5 \u003c= P \u003c= 3 x 10^5\r\n* 1 \u003c= V \u003c= 10\r\n* 300 \u003c= T \u003c= 500\r\n\r\nOutput the value of the missing quantity rounded to 2 decimal places, followed by a space, and then the correct units, either |Pa|, |m^3|, or |K|. For this, you can use |sprintf|. See sample test cases:\r\n\r\n  \u003e\u003e idealgas([233424.06 NaN 435.02])\r\nans =\r\n    '1.55 m^3'\r\n\u003e\u003e idealgas([109238.31 2.76 NaN])\r\nans =\r\n    '362.64 K'\r\n\u003e\u003e idealgas([NaN 1.19 411.97])\r\nans =\r\n    '287825.09 Pa'\r\n","description_html":"\u003cp\u003eConsider 100 mol of helium gas at a certain pressure (P), volume (V), and temperature (T). Assuming that the ideal gas law applies, can you compute one of the 3 quantities given the other two?\u003c/p\u003e\u003cp\u003eRecall that, with SI units, the ideal gas law is given by:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eP x V = n x R x T\r\n  where:\r\n  P = pressure [Pa] or [kg/m/s^2]\r\n  V = volume [m^3]\r\n  n = number of moles [mol]\r\n  R = gas constant, 8.314 [J/mol/K] or [kg.m^2/K/mol/s^2]\r\n  T = temperature [K]\r\n\u003c/pre\u003e\u003cp\u003eWrite a function that takes a MATLAB variable, x, which is always a 3-element row vector containing the values of P, V, T in that order. However, exactly one of these values will be NaN, which you must solve using the ideal gas law equation above, given the other two values. All inputs are given in SI units, hence, you can use the given value of \u003ctt\u003eR\u003c/tt\u003e above. Note that \u003ctt\u003en\u003c/tt\u003e = 100 mol. You are ensured that P, V, and/or T are floating-point numbers with 2 decimal places that satisfy the following constraints:\u003c/p\u003e\u003cul\u003e\u003cli\u003e1 x 10^5 \u0026lt;= P \u0026lt;= 3 x 10^5\u003c/li\u003e\u003cli\u003e1 \u0026lt;= V \u0026lt;= 10\u003c/li\u003e\u003cli\u003e300 \u0026lt;= T \u0026lt;= 500\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eOutput the value of the missing quantity rounded to 2 decimal places, followed by a space, and then the correct units, either \u003ctt\u003ePa\u003c/tt\u003e, \u003ctt\u003em^3\u003c/tt\u003e, or \u003ctt\u003eK\u003c/tt\u003e. For this, you can use \u003ctt\u003esprintf\u003c/tt\u003e. See sample test cases:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e\u0026gt;\u0026gt; idealgas([233424.06 NaN 435.02])\r\nans =\r\n  '1.55 m^3'\r\n\u0026gt;\u0026gt; idealgas([109238.31 2.76 NaN])\r\nans =\r\n  '362.64 K'\r\n\u0026gt;\u0026gt; idealgas([NaN 1.19 411.97])\r\nans =\r\n  '287825.09 Pa'\r\n\u003c/pre\u003e","function_template":"function y = idealgas(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(idealgas([233424.06 NaN 435.02]),'1.55 m^3'))\r\n%%\r\nassert(isequal(idealgas([294119.71 NaN 317.25]),'0.90 m^3'))\r\n%%\r\nassert(isequal(idealgas([173530.58 2.85 NaN]),'594.85 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.49 410.36]),'75985.15 Pa'))\r\n%%\r\nassert(isequal(idealgas([228388.12 5.36 NaN]),'1472.41 K'))\r\n%%\r\nassert(isequal(idealgas([120121.26 NaN 347.47]),'2.40 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.65 320.97]),'57388.06 Pa'))\r\n%%\r\nassert(isequal(idealgas([256885.58 3.62 NaN]),'1118.51 K'))\r\n%%\r\nassert(isequal(idealgas([186497.00 NaN 451.62]),'2.01 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.99 486.75]),'203358.77 Pa'))\r\n%%\r\nassert(isequal(idealgas([153235.77 8.18 NaN]),'1507.66 K'))\r\n%%\r\nassert(isequal(idealgas([179201.35 3.46 NaN]),'745.77 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 5.07 421.97]),'69196.42 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.95 439.29]),'45940.34 Pa'))\r\n%%\r\nassert(isequal(idealgas([126030.29 NaN 301.56]),'1.99 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.51 406.24]),'44973.09 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.14 326.86]),'126986.64 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.51 339.25]),'112371.49 Pa'))\r\n%%\r\nassert(isequal(idealgas([163285.80 2.96 NaN]),'581.34 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 6.00 336.89]),'46681.72 Pa'))\r\n%%\r\nassert(isequal(idealgas([115469.36 NaN 441.34]),'3.18 m^3'))\r\n%%\r\nassert(isequal(idealgas([162685.80 2.50 NaN]),'489.19 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 3.32 379.36]),'94999.97 Pa'))\r\n%%\r\nassert(isequal(idealgas([236819.21 NaN 496.57]),'1.74 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.39 376.27]),'130891.58 Pa'))\r\n%%\r\nassert(isequal(idealgas([251622.49 8.84 NaN]),'2675.42 K'))\r\n%%\r\nassert(isequal(idealgas([158829.73 NaN 466.48]),'2.44 m^3'))\r\n%%\r\nassert(isequal(idealgas([167062.27 NaN 390.52]),'1.94 m^3'))\r\n%%\r\nassert(isequal(idealgas([171921.26 NaN 448.51]),'2.17 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.12 304.89]),'119568.65 Pa'))\r\n%%\r\nassert(isequal(idealgas([163504.12 6.88 NaN]),'1353.03 K'))\r\n%%\r\nassert(isequal(idealgas([191577.27 3.16 NaN]),'728.15 K'))\r\n%%\r\nassert(isequal(idealgas([248129.61 7.69 NaN]),'2295.06 K'))\r\n%%\r\nassert(isequal(idealgas([192652.12 2.91 NaN]),'674.31 K'))\r\n%%\r\nassert(isequal(idealgas([135001.95 2.47 NaN]),'401.08 K'))\r\n%%\r\nassert(isequal(idealgas([203311.64 7.32 NaN]),'1790.04 K'))\r\n%%\r\nassert(isequal(idealgas([208176.82 7.12 NaN]),'1782.80 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.08 405.01]),'161887.17 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.59 383.02]),'69377.52 Pa'))\r\n%%\r\nassert(isequal(idealgas([151077.35 NaN 484.74]),'2.67 m^3'))\r\n%%\r\nassert(isequal(idealgas([286522.71 2.47 NaN]),'851.23 K'))\r\n%%\r\nassert(isequal(idealgas([215478.84 4.96 NaN]),'1285.51 K'))\r\n%%\r\nassert(isequal(idealgas([145733.90 1.58 NaN]),'276.95 K'))\r\n%%\r\nassert(isequal(idealgas([243042.50 NaN 383.81]),'1.31 m^3'))\r\n%%\r\nassert(isequal(idealgas([263228.02 3.86 NaN]),'1222.11 K'))\r\n%%\r\nassert(isequal(idealgas([270452.78 5.55 NaN]),'1805.40 K'))\r\n%%\r\nassert(isequal(idealgas([188792.83 NaN 473.35]),'2.08 m^3'))\r\n%%\r\nassert(isequal(idealgas([171014.73 NaN 344.83]),'1.68 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.49 328.44]),'60816.26 Pa'))\r\n%%\r\nassert(isequal(idealgas([184222.45 NaN 445.16]),'2.01 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.61 414.21]),'45252.85 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 3.39 484.92]),'118926.99 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.79 428.02]),'198802.14 Pa'))\r\n%%\r\nassert(isequal(idealgas([109010.22 NaN 369.49]),'2.82 m^3'))\r\n%%\r\nassert(isequal(idealgas([176773.72 6.65 NaN]),'1413.93 K'))\r\n%%\r\nassert(isequal(idealgas([260111.73 NaN 462.62]),'1.48 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 6.18 406.01]),'54620.83 Pa'))\r\n%%\r\nassert(isequal(idealgas([149725.79 5.06 NaN]),'911.25 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.27 407.13]),'266525.89 Pa'))\r\n%%\r\nassert(isequal(idealgas([260418.29 9.90 NaN]),'3100.96 K'))\r\n%%\r\nassert(isequal(idealgas([103635.51 NaN 456.75]),'3.66 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 9.09 425.19]),'38889.22 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.64 308.36]),'97110.04 Pa'))\r\n%%\r\nassert(isequal(idealgas([223288.70 NaN 370.89]),'1.38 m^3'))\r\n%%\r\nassert(isequal(idealgas([296869.88 9.51 NaN]),'3395.76 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.03 432.48]),'89221.80 Pa'))\r\n%%\r\nassert(isequal(idealgas([159101.45 NaN 405.57]),'2.12 m^3'))\r\n%%\r\nassert(isequal(idealgas([220527.64 NaN 416.71]),'1.57 m^3'))\r\n%%\r\nassert(isequal(idealgas([216714.12 5.61 NaN]),'1462.31 K'))\r\n%%\r\nassert(isequal(idealgas([299231.22 NaN 494.25]),'1.37 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 5.09 382.69]),'62508.54 Pa'))\r\n%%\r\nassert(isequal(idealgas([125130.92 3.78 NaN]),'568.91 K'))\r\n%%\r\nassert(isequal(idealgas([238757.52 1.09 NaN]),'313.02 K'))\r\n%%\r\nassert(isequal(idealgas([254190.84 1.38 NaN]),'421.92 K'))\r\n%%\r\nassert(isequal(idealgas([245902.61 3.02 NaN]),'893.22 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 6.61 347.29]),'43681.83 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.90 486.90]),'51241.60 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.89 397.95]),'175055.89 Pa'))\r\n%%\r\nassert(isequal(idealgas([279178.31 NaN 308.83]),'0.92 m^3'))\r\n%%\r\nassert(isequal(idealgas([254499.01 NaN 335.80]),'1.10 m^3'))\r\n%%\r\nassert(isequal(idealgas([142029.13 NaN 481.27]),'2.82 m^3'))\r\n%%\r\nassert(isequal(idealgas([120306.78 NaN 310.92]),'2.15 m^3'))\r\n%%\r\nassert(isequal(idealgas([186344.23 NaN 462.32]),'2.06 m^3'))\r\n%%\r\nassert(isequal(idealgas([278889.55 2.24 NaN]),'751.40 K'))\r\n%%\r\nassert(isequal(idealgas([283498.77 NaN 423.67]),'1.24 m^3'))\r\n%%\r\nassert(isequal(idealgas([287205.47 NaN 446.12]),'1.29 m^3'))\r\n%%\r\nassert(isequal(idealgas([266630.40 4.58 NaN]),'1468.81 K'))\r\n%%\r\nassert(isequal(idealgas([164492.08 NaN 495.83]),'2.51 m^3'))\r\n%%\r\nassert(isequal(idealgas([166084.72 6.58 NaN]),'1314.45 K'))\r\n%%\r\nassert(isequal(idealgas([182780.15 5.43 NaN]),'1193.76 K'))\r\n%%\r\nassert(isequal(idealgas([165550.99 8.54 NaN]),'1700.51 K'))\r\n%%\r\nassert(isequal(idealgas([NaN 4.21 432.53]),'85416.97 Pa'))\r\n%%\r\nassert(isequal(idealgas([146076.61 NaN 424.91]),'2.42 m^3'))\r\n%%\r\nassert(isequal(idealgas([232087.59 NaN 369.76]),'1.32 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 7.44 471.24]),'52659.80 Pa'))\r\n%%\r\nassert(isequal(idealgas([NaN 2.24 467.34]),'173458.25 Pa'))\r\n%%\r\nassert(isequal(idealgas([217641.88 NaN 461.35]),'1.76 m^3'))\r\n%%\r\nassert(isequal(idealgas([197918.87 NaN 370.63]),'1.56 m^3'))\r\n%%\r\nassert(isequal(idealgas([NaN 1.38 494.59]),'297972.56 Pa'))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":0,"created_by":255320,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":190,"test_suite_updated_at":"2020-03-31T14:35:13.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-03-31T13:58:54.000Z","updated_at":"2026-04-09T21:32:56.000Z","published_at":"2020-03-31T14:35:13.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 100 mol of helium gas at a certain pressure (P), volume (V), and temperature (T). Assuming that the ideal gas law applies, can you compute one of the 3 quantities given the other two?\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\u003eRecall that, with SI units, the ideal gas law 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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[P x V = n x R x T\\n  where:\\n  P = pressure [Pa] or [kg/m/s^2]\\n  V = volume [m^3]\\n  n = number of moles [mol]\\n  R = gas constant, 8.314 [J/mol/K] or [kg.m^2/K/mol/s^2]\\n  T = temperature [K]]]\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\u003eWrite a function that takes a MATLAB variable, x, which is always a 3-element row vector containing the values of P, V, T in that order. However, exactly one of these values will be NaN, which you must solve using the ideal gas law equation above, given the other two values. All inputs are given in SI units, hence, you can use the given value of\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eR\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e above. Note that\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e = 100 mol. You are ensured that P, V, and/or T are floating-point numbers with 2 decimal places that satisfy the following constraints:\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\u003e1 x 10^5 \u0026lt;= P \u0026lt;= 3 x 10^5\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\u003e1 \u0026lt;= V \u0026lt;= 10\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\u003e300 \u0026lt;= T \u0026lt;= 500\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 the value of the missing quantity rounded to 2 decimal places, followed by a space, and then the correct units, either\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:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ePa\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:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em^3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, or\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. For this, you can use\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003esprintf\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. See sample test cases:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[\u003e\u003e idealgas([233424.06 NaN 435.02])\\nans =\\n  '1.55 m^3'\\n\u003e\u003e idealgas([109238.31 2.76 NaN])\\nans =\\n  '362.64 K'\\n\u003e\u003e idealgas([NaN 1.19 411.97])\\nans =\\n  '287825.09 Pa']]\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:\"round\"","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:\"round\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"round\"","","\"","round","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007ffbbfb6eed8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007ffbbfb6ee38\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007ffbbfb6e578\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007ffbbfb6f158\u003e":1,"#\u003cMathWorks::Search::Field:0x00007ffbbfb6f0b8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007ffbbfb6f018\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007ffbbfb6ef78\u003e":"tag:\"round\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007ffbbfb6ef78\u003e":"tag:\"round\""},"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:\"round\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"round\"","","\"","round","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007ffbbfb6eed8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007ffbbfb6ee38\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007ffbbfb6e578\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007ffbbfb6f158\u003e":1,"#\u003cMathWorks::Search::Field:0x00007ffbbfb6f0b8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007ffbbfb6f018\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007ffbbfb6ef78\u003e":"tag:\"round\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007ffbbfb6ef78\u003e":"tag:\"round\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":46736,"difficulty_rating":"easy"},{"id":44228,"difficulty_rating":"easy"},{"id":43148,"difficulty_rating":"easy"},{"id":45392,"difficulty_rating":"easy-medium"},{"id":45391,"difficulty_rating":"easy-medium"},{"id":45411,"difficulty_rating":"easy-medium"}]}}