Cody

# Problem 106. Weighted average

Solution 1229984

Submitted on 12 Jul 2017 by Dustin Jones
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 2 3]; w = [10 15 20]; y_correct = 100/3; assert(isequal(weighted_average(x,w),y_correct))

y = 33.3333

2   Pass
x = [0 -2 3]; w = [10 0 10]; y_correct = 10; assert(isequal(weighted_average(x,w),y_correct))

y = 10
{"ft_lang_label":"__label__en","ft_lang_prob":0.6386589,"math_prob":0.9934522,"size":550,"snap":"2019-35-2019-39","text_gpt3_token_len":185,"char_repetition_ratio":0.13003664,"word_repetition_ratio":0.0,"special_character_ratio":0.40727273,"punctuation_ratio":0.2,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97826284,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-18T17:21:11Z\",\"WARC-Record-ID\":\"<urn:uuid:8f8e3098-bdec-4318-af3a-6f107b5ec12b>\",\"Content-Length\":\"70244\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b7976457-12de-4e15-9f78-fd9d9dd5daa9>\",\"WARC-Concurrent-To\":\"<urn:uuid:4f9841a3-6a12-4e9f-82d8-1310e5c73f8c>\",\"WARC-IP-Address\":\"104.110.193.39\",\"WARC-Target-URI\":\"https://de.mathworks.com/matlabcentral/cody/problems/106-weighted-average/solutions/1229984\",\"WARC-Payload-Digest\":\"sha1:INLUX5645VJNOWG4NCJKNHK7N3JYQT4R\",\"WARC-Block-Digest\":\"sha1:B472E77QIJFRML5XJZFS34MR5AM3LVWU\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514573309.22_warc_CC-MAIN-20190918151927-20190918173927-00345.warc.gz\"}"}