{"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":42737,"title":"Spherical Volume","description":"Calculate the volume of a sphere.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 106px 8px; transform-origin: 106px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCalculate the volume of a sphere.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Volume =VolumeOfSphere(radius)\r\n%\r\nend","test_suite":"tolerance = 1e-4;\r\n\r\n%%\r\nradius= 1;\r\nVolume_correct =  4.1888;\r\nassert(abs(VolumeOfSphere(radius) - Volume_correct) \u003c tolerance);\r\n\r\n%%\r\nradius= 2;\r\nVolume_correct =  33.5103;\r\nassert(abs(VolumeOfSphere(radius) - Volume_correct) \u003c tolerance);\r\n\r\n%%\r\nradius= 3;\r\nVolume_correct =  113.0973;\r\nassert(abs(VolumeOfSphere(radius) - Volume_correct) \u003c tolerance);","published":true,"deleted":false,"likes_count":7,"comments_count":4,"created_by":62653,"edited_by":223089,"edited_at":"2022-10-18T08:37:47.000Z","deleted_by":null,"deleted_at":null,"solvers_count":678,"test_suite_updated_at":"2020-10-08T13:11:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-02-19T00:29:06.000Z","updated_at":"2026-03-24T19:59:21.000Z","published_at":"2016-02-19T00:30:04.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the volume of a sphere.\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":44506,"title":"Volume of Spherical Shell","description":"In three-dimensional space, a spherical shell can be constructed from two concentric spheres.  Determine the volume of a spherical shell whose inner radius is r1 and outer radius is r2.","description_html":"\u003cp\u003eIn three-dimensional space, a spherical shell can be constructed from two concentric spheres.  Determine the volume of a spherical shell whose inner radius is r1 and outer radius is r2.\u003c/p\u003e","function_template":"function vol = Shell(r1,r2)\r\n  vol = r1*r2;\r\nend","test_suite":"%%\r\nr1=3.2;\r\nr2=3.8;\r\ny_correct=92.58902;\r\nassert(abs(Shell(r1,r2)-y_correct)\u003c1e-5)\r\n%%\r\nr1=1;\r\nr2=2;\r\ny_correct=29.32153;\r\nassert(abs(Shell(r1,r2)-y_correct)\u003c1e-5)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":80,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-01-24T18:30:33.000Z","updated_at":"2026-03-10T15:09:47.000Z","published_at":"2018-01-24T18:30:33.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn three-dimensional space, a spherical shell can be constructed from two concentric spheres. Determine the volume of a spherical shell whose inner radius is r1 and outer radius is r2.\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":1315,"title":"Volume of a sphere given its surface area","description":"You just measured its surface area, that is the input.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 10.5px; vertical-align: baseline; perspective-origin: 332px 10.5px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eYou just measured its surface area, that is the input.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = sphere_volume(x)\r\n  y = x;\r\nend","test_suite":"tolerance = 1e-4;\r\n\r\n%%\r\nx = 4*pi;\r\ny_correct = 4*pi/3;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 36*pi;\r\ny_correct = 36*pi;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 6;\r\ny_correct = sqrt(6/pi);\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = pi;\r\ny_correct = pi/6;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 10*pi;\r\ny_correct = 16.5576;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 17*pi;\r\ny_correct = 36.7005;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 42;\r\ny_correct = 25.5946;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 1/pi;\r\ny_correct = 0.0169;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":6,"created_by":11326,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":155,"test_suite_updated_at":"2020-09-29T12:58:00.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-03-03T23:04:23.000Z","updated_at":"2026-03-15T04:03:33.000Z","published_at":"2013-03-03T23:05:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou just measured its surface area, that is the input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44882,"title":"Opposite point of the earth, what is the antipodal of a point ?","description":"Given two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal).  \r\n The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u003cnothing\u003e', equal the point(.)) and C the cardinal point (S,N,E or W). \r\nYou have to return two strings (lat and long) with the same format that the input.\r\n\r\n*Extra question:* What is the opposite point of north pole? And why is not possible to calculate it by this method ?\r\n\r\nSuppose the earth is spherical, not flat (Lol)","description_html":"\u003cp\u003eGiven two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal).  \r\n The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u0026lt;nothing\u0026gt;', equal the point(.)) and C the cardinal point (S,N,E or W). \r\nYou have to return two strings (lat and long) with the same format that the input.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExtra question:\u003c/b\u003e What is the opposite point of north pole? And why is not possible to calculate it by this method ?\u003c/p\u003e\u003cp\u003eSuppose the earth is spherical, not flat (Lol)\u003c/p\u003e","function_template":"function [lat_o,long_o] = opposite_earth_point(lat,long)\r\n  [lat_o long_o] = [lat long];\r\nend","test_suite":"%% \r\n%Mathworks headquarters\r\nlat = '42.3 N';\r\nlong = '71.37 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct = '42.3 S';\r\nlong_o_correct = '108.63 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%% \r\n%San Antonio\r\nlat = '29.31 N';\r\nlong = '98.46 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct = '29.31 S';\r\nlong_o_correct= '81.54 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%My city \r\nlat = '32.9 S';\r\nlong = '68.82 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '32.9 N';\r\nlong_o_correct = '111.18 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Big Ben \r\nlat = '51.5 N';\r\nlong = '0.12 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '51.5 S';\r\nlong_o_correct = '179.88 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Wellington\r\nlat = '41.27 S';\r\nlong = '174.78 E';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '41.27 N';\r\nlong_o_correct = '5.22 W';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Some point of Brasil\r\nlat = '1 S';\r\nlong = '50 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '1 N';\r\nlong_o_correct = '130 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n% Some point near to Moscú\r\nlat = '55 N';\r\nlong = '37 E';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '55 S';\r\nlong_o_correct = '143 W';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":289312,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2019-04-18T18:26:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-04-18T18:22:19.000Z","updated_at":"2026-03-16T13:49:41.000Z","published_at":"2019-04-18T18:22:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal). The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u0026lt;nothing\u0026gt;', equal the point(.)) and C the cardinal point (S,N,E or W). You have to return two strings (lat and long) with the same format that the input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExtra question:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e What is the opposite point of north pole? And why is not possible to calculate it by this method ?\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\u003eSuppose the earth is spherical, not flat (Lol)\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":55415,"title":"3D Plots and Colorbars","description":"Use the matrices X, Y, and Z provided in the function template to create a surface plot. Add a colorbar to the surface plot and label its y-axis  \"Here is a colorbar\". Your function should return the figure handle as output.\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 72px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 36px; transform-origin: 407px 36px; 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: 384px 21px; text-align: left; transform-origin: 384px 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: 379.5px 8px; transform-origin: 379.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUse the matrices X, Y, and Z provided in the function template to create a surface plot. Add a colorbar to the surface plot and label its y-axis  \"Here is a colorbar\". Your function should return the figure handle as output.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function f = myfunction\r\n   f = figure; % gets the figure handle\r\n   [X,Y,Z] = sphere(20);\r\n\r\n\r\nend","test_suite":"%% Check surface plot\r\nf = myfunction;\r\ns__ = findobj(f,'Type','surface');\r\nassert( ~isempty(s__) )\r\n%% Check XData\r\nf = myfunction;\r\n[X,Y,Z] = sphere(20);\r\ns__ = findobj(f,'Type','surface');\r\nassert(isequaln(X(:),s__.XData(:)))\r\n%% Check YData\r\nf = myfunction;\r\n[X,Y,Z] = sphere(20);\r\ns__ = findobj(f,'Type','surface');\r\nassert(isequaln(Y(:),s__.YData(:)))\r\n%% Check ZData\r\nf = myfunction;\r\n[X,Y,Z] = sphere(20);\r\ns__ = findobj(f,'Type','surface');\r\nassert(isequaln(Z(:),s__.ZData(:)))\r\n%%\r\nf = myfunction;\r\nassert(isequal(f.Children(1).Type,'colorbar'))\r\n%%\r\nf = myfunction;\r\nassert(isequal(f.Children(1).Label.String,\"Here is a colorbar\"))","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":140016,"edited_by":287,"edited_at":"2022-10-10T14:36:25.000Z","deleted_by":null,"deleted_at":null,"solvers_count":253,"test_suite_updated_at":"2022-10-10T14:26:00.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-02T17:46:13.000Z","updated_at":"2026-04-09T11:03:41.000Z","published_at":"2022-10-10T14:26:00.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\u003eUse the matrices X, Y, and Z provided in the function template to create a surface plot. Add a colorbar to the surface plot and label its y-axis  \\\"Here is a colorbar\\\". Your function should return the figure handle as output.\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":2582,"title":"Cut an orange","description":"Inspired by problem \u003chttp://www.mathworks.co.uk/matlabcentral/cody/problems/2175 2175\u003e.\r\n\r\nA hungry matlab enthusiast has an orange. He decides to cut it into pieces using three dimensional grid.\r\n\r\nGiven grid density _N_ please help him to find the number of ideal cubes full of juicy orange and the number of pieces containing also some peel.\r\n\r\nExample: For _N=3_ matlab enthusiast is not satisfied. He gets [1 26]. Only one cube and 26 unpeeled pieces!\r\n\r\nRelated problems:\r\n\r\n\u003chttp://www.mathworks.co.uk/matlabcentral/cody/problems/554 554\u003e, \u003chttp://www.mathworks.co.uk/matlabcentral/cody/problems/1283 1283\u003e, \u003chttp://www.mathworks.co.uk/matlabcentral/cody/problems/1387 1387\u003e\r\n\r\n\r\n\r\n","description_html":"\u003cp\u003eInspired by problem \u003ca href = \"http://www.mathworks.co.uk/matlabcentral/cody/problems/2175\"\u003e2175\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eA hungry matlab enthusiast has an orange. He decides to cut it into pieces using three dimensional grid.\u003c/p\u003e\u003cp\u003eGiven grid density \u003ci\u003eN\u003c/i\u003e please help him to find the number of ideal cubes full of juicy orange and the number of pieces containing also some peel.\u003c/p\u003e\u003cp\u003eExample: For \u003ci\u003eN=3\u003c/i\u003e matlab enthusiast is not satisfied. He gets [1 26]. Only one cube and 26 unpeeled pieces!\u003c/p\u003e\u003cp\u003eRelated problems:\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.co.uk/matlabcentral/cody/problems/554\"\u003e554\u003c/a\u003e, \u003ca href = \"http://www.mathworks.co.uk/matlabcentral/cody/problems/1283\"\u003e1283\u003c/a\u003e, \u003ca href = \"http://www.mathworks.co.uk/matlabcentral/cody/problems/1387\"\u003e1387\u003c/a\u003e\u003c/p\u003e","function_template":"function pieces=cut_orange(N)\r\n \r\n  cubes = ...\r\n  rest = ...\r\n  pieces=[cubes, rest];\r\n\r\nend\r\n","test_suite":"%% Grid with N=1 doesn't cut the orange, it represents the smallest cube that orange can fit in. There are no juicy cubes, one piece sorrounded by peel.\r\nN = 1;\r\ny_correct = [0 1];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 1;\r\ny_correct = [0 1];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 2;\r\ny_correct = [0 8];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 3;\r\ny_correct = [1 26];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 4;\r\ny_correct = [8 56];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 5;\r\ny_correct = [19 98]; % was [27 90] \r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 6;\r\ny_correct = [32 152]; % was [56 128];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 7;\r\ny_correct = [81 194];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 8;\r\ny_correct = [136 272]; % was [160 248];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 9;\r\ny_correct = [203 362]; % was [251 314];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 10;\r\ny_correct = [304 416]; % was [312 408];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\n% finally more cubes than peels!\r\nN = 13;\r\nassert(isequal(-diff(cut_orange(N)),5))\r\n\r\n%%\r\nN = 19;\r\ny_correct = [2769 1658];\r\nassert(isequal(cut_orange(N),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":22,"test_suite_updated_at":"2014-10-08T09:45:10.000Z","rescore_all_solutions":false,"group_id":26,"created_at":"2014-09-12T10:39:45.000Z","updated_at":"2026-02-19T10:43:30.000Z","published_at":"2014-09-12T12:37:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eInspired by problem\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.co.uk/matlabcentral/cody/problems/2175\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e2175\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA hungry matlab enthusiast has an orange. He decides to cut it into pieces using three dimensional grid.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven grid density\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e please help him to find the number of ideal cubes full of juicy orange and the number of pieces containing also some peel.\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: For\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN=3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e matlab enthusiast is not satisfied. He gets [1 26]. Only one cube and 26 unpeeled pieces!\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\u003eRelated problems:\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:hyperlink w:docLocation=\\\"http://www.mathworks.co.uk/matlabcentral/cody/problems/554\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e554\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"http://www.mathworks.co.uk/matlabcentral/cody/problems/1283\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e1283\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"http://www.mathworks.co.uk/matlabcentral/cody/problems/1387\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e1387\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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":42737,"title":"Spherical Volume","description":"Calculate the volume of a sphere.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 106px 8px; transform-origin: 106px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eCalculate the volume of a sphere.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function Volume =VolumeOfSphere(radius)\r\n%\r\nend","test_suite":"tolerance = 1e-4;\r\n\r\n%%\r\nradius= 1;\r\nVolume_correct =  4.1888;\r\nassert(abs(VolumeOfSphere(radius) - Volume_correct) \u003c tolerance);\r\n\r\n%%\r\nradius= 2;\r\nVolume_correct =  33.5103;\r\nassert(abs(VolumeOfSphere(radius) - Volume_correct) \u003c tolerance);\r\n\r\n%%\r\nradius= 3;\r\nVolume_correct =  113.0973;\r\nassert(abs(VolumeOfSphere(radius) - Volume_correct) \u003c tolerance);","published":true,"deleted":false,"likes_count":7,"comments_count":4,"created_by":62653,"edited_by":223089,"edited_at":"2022-10-18T08:37:47.000Z","deleted_by":null,"deleted_at":null,"solvers_count":678,"test_suite_updated_at":"2020-10-08T13:11:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-02-19T00:29:06.000Z","updated_at":"2026-03-24T19:59:21.000Z","published_at":"2016-02-19T00:30:04.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the volume of a sphere.\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":44506,"title":"Volume of Spherical Shell","description":"In three-dimensional space, a spherical shell can be constructed from two concentric spheres.  Determine the volume of a spherical shell whose inner radius is r1 and outer radius is r2.","description_html":"\u003cp\u003eIn three-dimensional space, a spherical shell can be constructed from two concentric spheres.  Determine the volume of a spherical shell whose inner radius is r1 and outer radius is r2.\u003c/p\u003e","function_template":"function vol = Shell(r1,r2)\r\n  vol = r1*r2;\r\nend","test_suite":"%%\r\nr1=3.2;\r\nr2=3.8;\r\ny_correct=92.58902;\r\nassert(abs(Shell(r1,r2)-y_correct)\u003c1e-5)\r\n%%\r\nr1=1;\r\nr2=2;\r\ny_correct=29.32153;\r\nassert(abs(Shell(r1,r2)-y_correct)\u003c1e-5)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":80,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-01-24T18:30:33.000Z","updated_at":"2026-03-10T15:09:47.000Z","published_at":"2018-01-24T18:30:33.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn three-dimensional space, a spherical shell can be constructed from two concentric spheres. Determine the volume of a spherical shell whose inner radius is r1 and outer radius is r2.\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":1315,"title":"Volume of a sphere given its surface area","description":"You just measured its surface area, that is the input.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20px; 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: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; transform-origin: 332px 10.5px; vertical-align: baseline; perspective-origin: 332px 10.5px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; transform-origin: 309px 10.5px; white-space: pre-wrap; perspective-origin: 309px 10.5px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; transform-origin: 0px 0px; perspective-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eYou just measured its surface area, that is the input.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = sphere_volume(x)\r\n  y = x;\r\nend","test_suite":"tolerance = 1e-4;\r\n\r\n%%\r\nx = 4*pi;\r\ny_correct = 4*pi/3;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 36*pi;\r\ny_correct = 36*pi;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 6;\r\ny_correct = sqrt(6/pi);\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = pi;\r\ny_correct = pi/6;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 10*pi;\r\ny_correct = 16.5576;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 17*pi;\r\ny_correct = 36.7005;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 42;\r\ny_correct = 25.5946;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n\r\n%%\r\nx = 1/pi;\r\ny_correct = 0.0169;\r\nassert(abs(sphere_volume(x) - y_correct) \u003c tolerance)\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":6,"created_by":11326,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":155,"test_suite_updated_at":"2020-09-29T12:58:00.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-03-03T23:04:23.000Z","updated_at":"2026-03-15T04:03:33.000Z","published_at":"2013-03-03T23:05:47.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou just measured its surface area, that is the input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44882,"title":"Opposite point of the earth, what is the antipodal of a point ?","description":"Given two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal).  \r\n The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u003cnothing\u003e', equal the point(.)) and C the cardinal point (S,N,E or W). \r\nYou have to return two strings (lat and long) with the same format that the input.\r\n\r\n*Extra question:* What is the opposite point of north pole? And why is not possible to calculate it by this method ?\r\n\r\nSuppose the earth is spherical, not flat (Lol)","description_html":"\u003cp\u003eGiven two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal).  \r\n The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u0026lt;nothing\u0026gt;', equal the point(.)) and C the cardinal point (S,N,E or W). \r\nYou have to return two strings (lat and long) with the same format that the input.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExtra question:\u003c/b\u003e What is the opposite point of north pole? And why is not possible to calculate it by this method ?\u003c/p\u003e\u003cp\u003eSuppose the earth is spherical, not flat (Lol)\u003c/p\u003e","function_template":"function [lat_o,long_o] = opposite_earth_point(lat,long)\r\n  [lat_o long_o] = [lat long];\r\nend","test_suite":"%% \r\n%Mathworks headquarters\r\nlat = '42.3 N';\r\nlong = '71.37 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct = '42.3 S';\r\nlong_o_correct = '108.63 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%% \r\n%San Antonio\r\nlat = '29.31 N';\r\nlong = '98.46 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct = '29.31 S';\r\nlong_o_correct= '81.54 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%My city \r\nlat = '32.9 S';\r\nlong = '68.82 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '32.9 N';\r\nlong_o_correct = '111.18 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Big Ben \r\nlat = '51.5 N';\r\nlong = '0.12 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '51.5 S';\r\nlong_o_correct = '179.88 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Wellington\r\nlat = '41.27 S';\r\nlong = '174.78 E';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '41.27 N';\r\nlong_o_correct = '5.22 W';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Some point of Brasil\r\nlat = '1 S';\r\nlong = '50 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '1 N';\r\nlong_o_correct = '130 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n% Some point near to Moscú\r\nlat = '55 N';\r\nlong = '37 E';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '55 S';\r\nlong_o_correct = '143 W';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":289312,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2019-04-18T18:26:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-04-18T18:22:19.000Z","updated_at":"2026-03-16T13:49:41.000Z","published_at":"2019-04-18T18:22:19.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal). The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u0026lt;nothing\u0026gt;', equal the point(.)) and C the cardinal point (S,N,E or W). You have to return two strings (lat and long) with the same format that the input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExtra question:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e What is the opposite point of north pole? And why is not possible to calculate it by this method ?\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\u003eSuppose the earth is spherical, not flat (Lol)\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":55415,"title":"3D Plots and Colorbars","description":"Use the matrices X, Y, and Z provided in the function template to create a surface plot. Add a colorbar to the surface plot and label its y-axis  \"Here is a colorbar\". Your function should return the figure handle as output.\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 72px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 36px; transform-origin: 407px 36px; 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: 384px 21px; text-align: left; transform-origin: 384px 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: 379.5px 8px; transform-origin: 379.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUse the matrices X, Y, and Z provided in the function template to create a surface plot. Add a colorbar to the surface plot and label its y-axis  \"Here is a colorbar\". Your function should return the figure handle as output.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function f = myfunction\r\n   f = figure; % gets the figure handle\r\n   [X,Y,Z] = sphere(20);\r\n\r\n\r\nend","test_suite":"%% Check surface plot\r\nf = myfunction;\r\ns__ = findobj(f,'Type','surface');\r\nassert( ~isempty(s__) )\r\n%% Check XData\r\nf = myfunction;\r\n[X,Y,Z] = sphere(20);\r\ns__ = findobj(f,'Type','surface');\r\nassert(isequaln(X(:),s__.XData(:)))\r\n%% Check YData\r\nf = myfunction;\r\n[X,Y,Z] = sphere(20);\r\ns__ = findobj(f,'Type','surface');\r\nassert(isequaln(Y(:),s__.YData(:)))\r\n%% Check ZData\r\nf = myfunction;\r\n[X,Y,Z] = sphere(20);\r\ns__ = findobj(f,'Type','surface');\r\nassert(isequaln(Z(:),s__.ZData(:)))\r\n%%\r\nf = myfunction;\r\nassert(isequal(f.Children(1).Type,'colorbar'))\r\n%%\r\nf = myfunction;\r\nassert(isequal(f.Children(1).Label.String,\"Here is a colorbar\"))","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":140016,"edited_by":287,"edited_at":"2022-10-10T14:36:25.000Z","deleted_by":null,"deleted_at":null,"solvers_count":253,"test_suite_updated_at":"2022-10-10T14:26:00.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-09-02T17:46:13.000Z","updated_at":"2026-04-09T11:03:41.000Z","published_at":"2022-10-10T14:26:00.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\u003eUse the matrices X, Y, and Z provided in the function template to create a surface plot. Add a colorbar to the surface plot and label its y-axis  \\\"Here is a colorbar\\\". Your function should return the figure handle as output.\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":2582,"title":"Cut an orange","description":"Inspired by problem \u003chttp://www.mathworks.co.uk/matlabcentral/cody/problems/2175 2175\u003e.\r\n\r\nA hungry matlab enthusiast has an orange. He decides to cut it into pieces using three dimensional grid.\r\n\r\nGiven grid density _N_ please help him to find the number of ideal cubes full of juicy orange and the number of pieces containing also some peel.\r\n\r\nExample: For _N=3_ matlab enthusiast is not satisfied. He gets [1 26]. Only one cube and 26 unpeeled pieces!\r\n\r\nRelated problems:\r\n\r\n\u003chttp://www.mathworks.co.uk/matlabcentral/cody/problems/554 554\u003e, \u003chttp://www.mathworks.co.uk/matlabcentral/cody/problems/1283 1283\u003e, \u003chttp://www.mathworks.co.uk/matlabcentral/cody/problems/1387 1387\u003e\r\n\r\n\r\n\r\n","description_html":"\u003cp\u003eInspired by problem \u003ca href = \"http://www.mathworks.co.uk/matlabcentral/cody/problems/2175\"\u003e2175\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eA hungry matlab enthusiast has an orange. He decides to cut it into pieces using three dimensional grid.\u003c/p\u003e\u003cp\u003eGiven grid density \u003ci\u003eN\u003c/i\u003e please help him to find the number of ideal cubes full of juicy orange and the number of pieces containing also some peel.\u003c/p\u003e\u003cp\u003eExample: For \u003ci\u003eN=3\u003c/i\u003e matlab enthusiast is not satisfied. He gets [1 26]. Only one cube and 26 unpeeled pieces!\u003c/p\u003e\u003cp\u003eRelated problems:\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://www.mathworks.co.uk/matlabcentral/cody/problems/554\"\u003e554\u003c/a\u003e, \u003ca href = \"http://www.mathworks.co.uk/matlabcentral/cody/problems/1283\"\u003e1283\u003c/a\u003e, \u003ca href = \"http://www.mathworks.co.uk/matlabcentral/cody/problems/1387\"\u003e1387\u003c/a\u003e\u003c/p\u003e","function_template":"function pieces=cut_orange(N)\r\n \r\n  cubes = ...\r\n  rest = ...\r\n  pieces=[cubes, rest];\r\n\r\nend\r\n","test_suite":"%% Grid with N=1 doesn't cut the orange, it represents the smallest cube that orange can fit in. There are no juicy cubes, one piece sorrounded by peel.\r\nN = 1;\r\ny_correct = [0 1];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 1;\r\ny_correct = [0 1];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 2;\r\ny_correct = [0 8];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 3;\r\ny_correct = [1 26];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 4;\r\ny_correct = [8 56];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 5;\r\ny_correct = [19 98]; % was [27 90] \r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 6;\r\ny_correct = [32 152]; % was [56 128];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 7;\r\ny_correct = [81 194];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 8;\r\ny_correct = [136 272]; % was [160 248];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 9;\r\ny_correct = [203 362]; % was [251 314];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\nN = 10;\r\ny_correct = [304 416]; % was [312 408];\r\nassert(isequal(cut_orange(N),y_correct))\r\n\r\n%%\r\n% finally more cubes than peels!\r\nN = 13;\r\nassert(isequal(-diff(cut_orange(N)),5))\r\n\r\n%%\r\nN = 19;\r\ny_correct = [2769 1658];\r\nassert(isequal(cut_orange(N),y_correct))","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":22,"test_suite_updated_at":"2014-10-08T09:45:10.000Z","rescore_all_solutions":false,"group_id":26,"created_at":"2014-09-12T10:39:45.000Z","updated_at":"2026-02-19T10:43:30.000Z","published_at":"2014-09-12T12:37:15.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"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\u003eInspired by problem\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.co.uk/matlabcentral/cody/problems/2175\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e2175\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA hungry matlab enthusiast has an orange. He decides to cut it into pieces using three dimensional grid.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven grid density\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e please help him to find the number of ideal cubes full of juicy orange and the number of pieces containing also some peel.\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: For\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN=3\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e matlab enthusiast is not satisfied. He gets [1 26]. Only one cube and 26 unpeeled pieces!\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\u003eRelated problems:\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:hyperlink w:docLocation=\\\"http://www.mathworks.co.uk/matlabcentral/cody/problems/554\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e554\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"http://www.mathworks.co.uk/matlabcentral/cody/problems/1283\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e1283\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"http://www.mathworks.co.uk/matlabcentral/cody/problems/1387\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e1387\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:\"sphere\"","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:\"sphere\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"sphere\"","","\"","sphere","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007fbf31793040\u003e":null,"#\u003cMathWorks::Search::Field:0x00007fbf31792fa0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007fbf317926e0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007fbf317932c0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007fbf31793220\u003e":50,"#\u003cMathWorks::Search::Field:0x00007fbf31793180\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007fbf317930e0\u003e":"tag:\"sphere\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007fbf317930e0\u003e":"tag:\"sphere\""},"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:\"sphere\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"sphere\"","","\"","sphere","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007fbf31793040\u003e":null,"#\u003cMathWorks::Search::Field:0x00007fbf31792fa0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007fbf317926e0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007fbf317932c0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007fbf31793220\u003e":50,"#\u003cMathWorks::Search::Field:0x00007fbf31793180\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007fbf317930e0\u003e":"tag:\"sphere\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007fbf317930e0\u003e":"tag:\"sphere\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":42737,"difficulty_rating":"easy"},{"id":44506,"difficulty_rating":"easy"},{"id":1315,"difficulty_rating":"easy"},{"id":44882,"difficulty_rating":"easy-medium"},{"id":55415,"difficulty_rating":"easy-medium"},{"id":2582,"difficulty_rating":"hard"}]}}