Cody

# Problem 42692. Polynomial Evaluation

Solution 802613

Submitted on 7 Jan 2016 by Duane Hanselman
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 = 3; coefficients = [-19, 7, -4, 6]; y_correct = 128; assert(isequal(your_fcn_name(x,coefficients),y_correct))

2   Pass
%% x = 21; coefficients = [5, -4, 7, -2]; y_correct = -15514; assert(isequal(your_fcn_name(x,coefficients),y_correct))

3   Pass
%% x = [11:15]; a = [-10:-6]; b = [6:2:14]; c = [-14:2:-6]; d = [2:-1:-2]; y_correct = [1024, 87 -1568 -4151 -7896]; for i = 1:5 coefficients = [a(i) b(i) c(i) d(i)]; assert(isequal(your_fcn_name(x(i),coefficients),y_correct(i))) end

### 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.67617697,"math_prob":0.990944,"size":869,"snap":"2020-45-2020-50","text_gpt3_token_len":299,"char_repetition_ratio":0.14219654,"word_repetition_ratio":0.0,"special_character_ratio":0.41542003,"punctuation_ratio":0.21390374,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9960799,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-10-20T09:01:38Z\",\"WARC-Record-ID\":\"<urn:uuid:d5c781b4-4fe8-4f50-b4b8-05f32ea16778>\",\"Content-Length\":\"78631\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:3aee2919-bab1-400f-9265-a59a4e9c9b5a>\",\"WARC-Concurrent-To\":\"<urn:uuid:3c0b479c-46ba-4483-b911-aac43e2a9a66>\",\"WARC-IP-Address\":\"184.24.72.83\",\"WARC-Target-URI\":\"https://es.mathworks.com/matlabcentral/cody/problems/42692-polynomial-evaluation/solutions/802613\",\"WARC-Payload-Digest\":\"sha1:6JLQX4SCVCOIWZOT5MHKV3BC6JW44YUQ\",\"WARC-Block-Digest\":\"sha1:EPFRH3IGT6BMVBGQDE5XAU7EXXQ7H6VW\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-45/CC-MAIN-2020-45_segments_1603107871231.19_warc_CC-MAIN-20201020080044-20201020110044-00095.warc.gz\"}"}