Cody

# Problem 106. Weighted average

Solution 895707

Submitted on 26 May 2016 by Montse
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))

2   Pass
x = [0 -2 3]; w = [10 0 10]; y_correct = 10; assert(isequal(weighted_average(x,w),y_correct))
{"ft_lang_label":"__label__en","ft_lang_prob":0.7357288,"math_prob":0.9886553,"size":642,"snap":"2020-10-2020-16","text_gpt3_token_len":202,"char_repetition_ratio":0.12068965,"word_repetition_ratio":0.0,"special_character_ratio":0.36292836,"punctuation_ratio":0.17567568,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96705216,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-02-24T06:52:01Z\",\"WARC-Record-ID\":\"<urn:uuid:163bf780-cce6-42a6-ad02-b23fe960620d>\",\"Content-Length\":\"71357\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c53a95d5-96f1-4ac8-9c37-a62ae2e1eee3>\",\"WARC-Concurrent-To\":\"<urn:uuid:28daaccc-84bd-425a-8833-056d84b4b4b8>\",\"WARC-IP-Address\":\"104.117.0.182\",\"WARC-Target-URI\":\"https://de.mathworks.com/matlabcentral/cody/problems/106-weighted-average/solutions/895707\",\"WARC-Payload-Digest\":\"sha1:WNKKKT2K6RFRZAU75EZTPL7GED4APLQG\",\"WARC-Block-Digest\":\"sha1:3TUCZ4B5AXPZYUU6PTCL22LS7D6HG34T\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-10/CC-MAIN-2020-10_segments_1581875145897.19_warc_CC-MAIN-20200224040929-20200224070929-00366.warc.gz\"}"}