Cody

# Problem 106. Weighted average

Solution 1217122

Submitted on 21 Jun 2017 by Alan Lai
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.6617166,"math_prob":0.98719937,"size":530,"snap":"2019-43-2019-47","text_gpt3_token_len":178,"char_repetition_ratio":0.1311787,"word_repetition_ratio":0.0,"special_character_ratio":0.3962264,"punctuation_ratio":0.2016129,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9690255,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-11-12T10:59:36Z\",\"WARC-Record-ID\":\"<urn:uuid:4fd57b02-7b8d-486c-b1e4-ffaa43a52397>\",\"Content-Length\":\"69444\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b8c0513b-5aab-4ab9-b8d8-9ad06b69f498>\",\"WARC-Concurrent-To\":\"<urn:uuid:6de26bde-bf60-4838-b280-4425331d42fd>\",\"WARC-IP-Address\":\"184.25.198.13\",\"WARC-Target-URI\":\"https://www.mathworks.com/matlabcentral/cody/problems/106-weighted-average/solutions/1217122\",\"WARC-Payload-Digest\":\"sha1:B7VJEBUAE2GE54GBS4TCS4FIAICL5SAA\",\"WARC-Block-Digest\":\"sha1:EF5NCPSRZD4LVNIYIUCQJ7SRKZNCVBJ4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-47/CC-MAIN-2019-47_segments_1573496665521.72_warc_CC-MAIN-20191112101343-20191112125343-00128.warc.gz\"}"}