Cody

# Problem 2019. Dimensions of a rectangle

Solution 1558607

Submitted on 12 Jun 2018 by Raymond Phan
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
x = 1 length_correct = 3/sqrt(10); width_correct = 1/sqrt(10); [width, length] = findRectangleDimensions(x); tolerance = 1e-12; assert( abs(length-length_correct)<tolerance && abs(width-width_correct)<tolerance )

x = 1

2   Pass
x = 2; width_correct = 2/sqrt(10); length_correct = 6/sqrt(10); [width, length] = findRectangleDimensions(x); tolerance = 1e-12; assert(abs(length-length_correct)<tolerance && abs(width-width_correct)<tolerance)

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
{"ft_lang_label":"__label__en","ft_lang_prob":0.61200184,"math_prob":0.9881505,"size":788,"snap":"2021-04-2021-17","text_gpt3_token_len":226,"char_repetition_ratio":0.1747449,"word_repetition_ratio":0.05882353,"special_character_ratio":0.2969543,"punctuation_ratio":0.1015625,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9882506,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-01-18T02:07:08Z\",\"WARC-Record-ID\":\"<urn:uuid:92c73495-9237-4648-8f4f-c2a4a9c3d5f4>\",\"Content-Length\":\"79780\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:14749276-e77c-4dad-9cde-f98c5e2873f2>\",\"WARC-Concurrent-To\":\"<urn:uuid:55ed48aa-8339-4fd4-b1ea-cb518d0d0fb0>\",\"WARC-IP-Address\":\"23.10.129.243\",\"WARC-Target-URI\":\"https://kr.mathworks.com/matlabcentral/cody/problems/2019-dimensions-of-a-rectangle/solutions/1558607\",\"WARC-Payload-Digest\":\"sha1:HZ5JLE2PV6KY2WNR6NMBUDVVMDHMKKRN\",\"WARC-Block-Digest\":\"sha1:6OPWKT5AEP467GMSN7JY474DRUW3VS44\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-04/CC-MAIN-2021-04_segments_1610703514046.20_warc_CC-MAIN-20210117235743-20210118025743-00485.warc.gz\"}"}