Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
user_solution = fileread('convpower.m');
assert(isempty(strfind(user_solution,'regexp')));
assert(isempty(strfind(user_solution,'2str')));
assert(isempty(strfind(user_solution,'str2')));
assert(isempty(strfind(user_solution,'interp')));
assert(isempty(strfind(user_solution,'printf')));
assert(isempty(strfind(user_solution,'assert')));
|
2 | Pass |
%%
x = [1 2 3];
n = 0;
y_correct = 1;
assert(isequal(convpower(x,n),y_correct))
|
3 | Pass |
%%
x = [3 8 1 2 3];
n = 1;
y_correct = [3 8 1 2 3];
assert(isequal(convpower(x,n),y_correct))
|
4 | Pass |
%%
x = [3 8 1 2 3];
n = 3;
y_correct = [27 216 603 710 570 876 763 354 390 260 63 54 27];
assert(isequal(convpower(x,n),y_correct))
|
5 | Pass |
%%
x = [1 3 2];
n = 2;
y_correct = [ 1 6 13 12 4];
assert(isequal(convpower(x,n),y_correct))
|
6 | Pass |
%%
x = [1 1];
n = 10;
y_correct = [ 1 10 45 120 210 252 210 120 45 10 1]
assert(isequal(convpower(x,n),y_correct))
y_correct =
1 10 45 120 210 252 210 120 45 10 1
|
7 | Pass |
%%
x = [1 5 2];
n = 7;
y_correct = [1 35 539 4795 27209 102725 261905 451225 523810 410900 217672 76720 17248 2240 128]
assert(isequal(convpower(x,n),y_correct))
y_correct =
Columns 1 through 8
1 35 539 4795 27209 102725 261905 451225
Columns 9 through 15
523810 410900 217672 76720 17248 2240 128
|
1365 Solvers
Given an unsigned integer x, find the largest y by rearranging the bits in x
780 Solvers
Matrix with different incremental runs
106 Solvers
What is the distance from point P(x,y) to the line Ax + By + C = 0?
277 Solvers
78 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!