{"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":47864,"title":"Calculate the Surface Area of an Ellipsoid","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: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 21px; transform-origin: 407px 21px; 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 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCalculate the Surface Area of an Ellipsoid: (x/a)^2+(y/b)^2+(z/c)^2=1. Input will be a matrix [a,b,c]. Round output to four decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function s = surfaceAreaEllipsoid(a)\r\n  s=a;\r\nend","test_suite":"%%\r\na =       [1          10         100\r\n           1           2         100\r\n           2           3        1000];\r\ns = [6384.7971,1521.9917,24921.4459];\r\nassert(isequal(surfaceAreaEllipsoid(a),s))\r\n%%\r\na =[23.4094   25.3969   17.6635\r\n   17.2337   19.4679   30.3974\r\n   27.2947   28.4956   20.7605\r\n   13.7477   23.0868   13.6015\r\n   26.2107   18.7350   30.0832\r\n   13.5647   30.6594   31.3050\r\n   19.2094   29.5973   20.9523\r\n   25.0200   23.4734   10.5830\r\n   27.9464   24.9600   16.0935\r\n    9.0554   24.2487   20.2237\r\n   30.4959   14.4222   24.3926\r\n   27.8568   17.3781   16.2173\r\n   22.0681   21.7025   24.5561\r\n   20.8806   15.1987   26.6833\r\n   21.1424   29.0689   14.8997\r\n   17.5214   13.9642   10.8628\r\n   22.5610   15.0333   17.2337\r\n   22.6053   13.0767   17.8606\r\n   28.6007   15.0997   20.6155\r\n   28.1957   20.8806   22.5389];\r\ns=114878.3893;\r\nassert(isequal(round(sum(surfaceAreaEllipsoid(a)),4),s))\r\n%%\r\na =[2.2361    1.4142    1.4142\r\n    3.7417    6.7082    6.1644\r\n    6.4031    6.7823    5.0990\r\n    1.4142    6.3246    4.8990\r\n    6.8557    2.2361    6.7823\r\n    6.0828    3.7417    5.5678\r\n    5.0000    4.1231    5.5678\r\n    5.3852    5.8310    6.5574\r\n    3.4641    2.6458    6.4031\r\n    4.7958    6.0828    5.3852\r\n    7.0000    2.4495    3.1623\r\n    5.2915    5.7446    3.4641\r\n    5.1962    5.0000    6.7082\r\n    3.4641    6.2450    1.4142\r\n    5.0000    6.0000    5.0000\r\n    5.6569    6.7823    3.0000\r\n    5.8310    6.7082    7.0000\r\n    4.4721    4.1231    6.0000\r\n    4.3589    5.9161    5.0990\r\n    7.0711    3.1623    4.8990];\r\ns=6319.9914;\r\nassert(isequal(round(sum(surfaceAreaEllipsoid(a)),4),s))\r\n%%\r\na =[815   656   439\r\n   906    36   382\r\n   127   850   766\r\n   914   934   796\r\n   633   679   187\r\n    98   758   490\r\n   279   744   446\r\n   547   393   647\r\n   958   656   710\r\n   965   172   755\r\n   158   707   277\r\n   971    32   680\r\n   958   277   656\r\n   486    47   163\r\n   801    98   119\r\n   142   824   499\r\n   422   695   960\r\n   916   318   341\r\n   793   951   586\r\n   960    35   224]\r\ns=[5044536.4000,2211672.3438,4352237.2825,9752711.8853,3142934.7619,2498034.8411,2902467.0124,3493778.3292,7487103.0719,5020531.2388,1596267.5211,4175258.0564,4870849.7171,548197.4954,866709.4797,2892741.9879,5916340.2965,3127474.1105,7530645.3854,1399379.0343];\r\nassert(isequal(surfaceAreaEllipsoid(a),s))","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":145982,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":"2020-12-18T14:43:49.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2020-12-10T00:32:35.000Z","updated_at":"2020-12-18T14:43:49.000Z","published_at":"2020-12-10T00:43:14.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\u003eCalculate the Surface Area of an Ellipsoid: (x/a)^2+(y/b)^2+(z/c)^2=1. Input will be a matrix [a,b,c]. Round output to four decimal places.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":47864,"title":"Calculate the Surface Area of an Ellipsoid","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: 42px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 21px; transform-origin: 407px 21px; 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 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eCalculate the Surface Area of an Ellipsoid: (x/a)^2+(y/b)^2+(z/c)^2=1. Input will be a matrix [a,b,c]. Round output to four decimal places.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function s = surfaceAreaEllipsoid(a)\r\n  s=a;\r\nend","test_suite":"%%\r\na =       [1          10         100\r\n           1           2         100\r\n           2           3        1000];\r\ns = [6384.7971,1521.9917,24921.4459];\r\nassert(isequal(surfaceAreaEllipsoid(a),s))\r\n%%\r\na =[23.4094   25.3969   17.6635\r\n   17.2337   19.4679   30.3974\r\n   27.2947   28.4956   20.7605\r\n   13.7477   23.0868   13.6015\r\n   26.2107   18.7350   30.0832\r\n   13.5647   30.6594   31.3050\r\n   19.2094   29.5973   20.9523\r\n   25.0200   23.4734   10.5830\r\n   27.9464   24.9600   16.0935\r\n    9.0554   24.2487   20.2237\r\n   30.4959   14.4222   24.3926\r\n   27.8568   17.3781   16.2173\r\n   22.0681   21.7025   24.5561\r\n   20.8806   15.1987   26.6833\r\n   21.1424   29.0689   14.8997\r\n   17.5214   13.9642   10.8628\r\n   22.5610   15.0333   17.2337\r\n   22.6053   13.0767   17.8606\r\n   28.6007   15.0997   20.6155\r\n   28.1957   20.8806   22.5389];\r\ns=114878.3893;\r\nassert(isequal(round(sum(surfaceAreaEllipsoid(a)),4),s))\r\n%%\r\na =[2.2361    1.4142    1.4142\r\n    3.7417    6.7082    6.1644\r\n    6.4031    6.7823    5.0990\r\n    1.4142    6.3246    4.8990\r\n    6.8557    2.2361    6.7823\r\n    6.0828    3.7417    5.5678\r\n    5.0000    4.1231    5.5678\r\n    5.3852    5.8310    6.5574\r\n    3.4641    2.6458    6.4031\r\n    4.7958    6.0828    5.3852\r\n    7.0000    2.4495    3.1623\r\n    5.2915    5.7446    3.4641\r\n    5.1962    5.0000    6.7082\r\n    3.4641    6.2450    1.4142\r\n    5.0000    6.0000    5.0000\r\n    5.6569    6.7823    3.0000\r\n    5.8310    6.7082    7.0000\r\n    4.4721    4.1231    6.0000\r\n    4.3589    5.9161    5.0990\r\n    7.0711    3.1623    4.8990];\r\ns=6319.9914;\r\nassert(isequal(round(sum(surfaceAreaEllipsoid(a)),4),s))\r\n%%\r\na =[815   656   439\r\n   906    36   382\r\n   127   850   766\r\n   914   934   796\r\n   633   679   187\r\n    98   758   490\r\n   279   744   446\r\n   547   393   647\r\n   958   656   710\r\n   965   172   755\r\n   158   707   277\r\n   971    32   680\r\n   958   277   656\r\n   486    47   163\r\n   801    98   119\r\n   142   824   499\r\n   422   695   960\r\n   916   318   341\r\n   793   951   586\r\n   960    35   224]\r\ns=[5044536.4000,2211672.3438,4352237.2825,9752711.8853,3142934.7619,2498034.8411,2902467.0124,3493778.3292,7487103.0719,5020531.2388,1596267.5211,4175258.0564,4870849.7171,548197.4954,866709.4797,2892741.9879,5916340.2965,3127474.1105,7530645.3854,1399379.0343];\r\nassert(isequal(surfaceAreaEllipsoid(a),s))","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":145982,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":"2020-12-18T14:43:49.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2020-12-10T00:32:35.000Z","updated_at":"2020-12-18T14:43:49.000Z","published_at":"2020-12-10T00:43:14.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\u003eCalculate the Surface Area of an Ellipsoid: (x/a)^2+(y/b)^2+(z/c)^2=1. Input will be a matrix [a,b,c]. Round output to four decimal places.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"term":"tag:\"ellipsoid\"","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:\"ellipsoid\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"ellipsoid\"","","\"","ellipsoid","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f3d5bf90200\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f3d5bf90160\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f3d5bfaf6f0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f3d5bf905c0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f3d5bf90520\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f3d5bf90340\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f3d5bf902a0\u003e":"tag:\"ellipsoid\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f3d5bf902a0\u003e":"tag:\"ellipsoid\""},"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:\"ellipsoid\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"ellipsoid\"","","\"","ellipsoid","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f3d5bf90200\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f3d5bf90160\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f3d5bfaf6f0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f3d5bf905c0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f3d5bf90520\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f3d5bf90340\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f3d5bf902a0\u003e":"tag:\"ellipsoid\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f3d5bf902a0\u003e":"tag:\"ellipsoid\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":47864,"difficulty_rating":"medium"}]}}