Cody

# Problem 106. Weighted average

Solution 284344

Submitted on 18 Jul 2013 by li
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)) x = [0 -2 3]; w = [10 0 10]; y_correct = 10; assert(isequal(weighted_average(x,w),y_correct))

### 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.70217353,"math_prob":0.96954036,"size":600,"snap":"2020-45-2020-50","text_gpt3_token_len":172,"char_repetition_ratio":0.11744966,"word_repetition_ratio":0.0,"special_character_ratio":0.325,"punctuation_ratio":0.12820514,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9775499,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-11-24T01:16:05Z\",\"WARC-Record-ID\":\"<urn:uuid:4723491b-6e01-4478-9244-85cc3a0e5ad4>\",\"Content-Length\":\"80946\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:23e09969-392b-4f4b-91d1-531d12e12a17>\",\"WARC-Concurrent-To\":\"<urn:uuid:0f7d726e-632a-494b-b732-84973913ea63>\",\"WARC-IP-Address\":\"23.32.68.178\",\"WARC-Target-URI\":\"https://www.mathworks.com/matlabcentral/cody/problems/106-weighted-average/solutions/284344\",\"WARC-Payload-Digest\":\"sha1:QKD2CKY36TOBINKKJGZDXGBEHSAXAT5Q\",\"WARC-Block-Digest\":\"sha1:TXQHLVLJTI3ITG5NQ5YJ64D2ZGZRRUWO\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141169606.2_warc_CC-MAIN-20201124000351-20201124030351-00431.warc.gz\"}"}