This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
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))
xpow =
625 125 25 5 1
y =
395 7 9
xpow =
2401 343 49 7 1
y =
395 1965 9
xpow =
6561 729 81 9 1
y =
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
xpow =
2187 729 243 81 27 9 3 1
y =
-260 7 4 5
xpow =
823543 117649 16807 2401 343 49 7 1
y =
-260 655500 4 5
xpow =
16384 4096 1024 256 64 16 4 1
y =
-260 655500 6138 5
xpow =
78125 15625 3125 625 125 25 5 1
y =
-260 655500 6138 46880
|
Sort a list of complex numbers based on far they are from the origin.
3791 Solvers
1913 Solvers
2472 Solvers
304 Solvers
264 Solvers