Cody

Solution 452114

Submitted on 8 Jun 2014 by rifat
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
%% p = [1 0 -8 -7 5]; x = [ 5 7 9 ]; y_correct = [ 395 1965 5855]; assert(isequal(polynomial(p,x),y_correct))

p = 1 0 -8 -7 5 1 0 -8 -7 5 1 0 -8 -7 5 x1 = 5 5 5 5 5 7 7 7 7 7 9 9 9 9 9 x2 = 4 3 2 1 0 4 3 2 1 0 4 3 2 1 0 ans = 395 1965 5855

2   Pass
%% p = [1 0 -10 0 0 0 11 -50]; x = [3 7 4 5]; y_correct = [-260 655500 6138 46880] assert(isequal(polynomial(p,x),y_correct))

y_correct = -260 655500 6138 46880 p = 1 0 -10 0 0 0 11 -50 1 0 -10 0 0 0 11 -50 1 0 -10 0 0 0 11 -50 1 0 -10 0 0 0 11 -50 x1 = 3 3 3 3 3 3 3 3 7 7 7 7 7 7 7 7 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 x2 = 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 ans = -260 655500 6138 46880

Suggested Problems

More from this Author4