Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
filetext = fileread('coeffArray.m');
assert(~contains(filetext,'regexp'))
|
2 | Pass |
exponents = 0;
coefficients = randi(1000);
cA = coefficients;
assert(isequal(coeffArray(exponents,coefficients),cA))
M =
1
V =
1
|
3 | Pass |
coefficients = randi(1000,[10 1]);
exponents = (9:-1:0)';
cA = coefficients;
assert(isequal(coeffArray(exponents,coefficients),cA))
M =
10
V =
1
|
4 | Pass |
a = randi(1000);
b = randi(1000);
exponents = [2 0; 0 1];
coefficients = [a; b];
cA = [0 a; 0 0; b 0];
assert(isequal(coeffArray(exponents,coefficients),cA))
M =
2
V =
2
|
5 | Pass |
a = randi(1000);
b = randi(1000);
c = randi(1000);
d = randi(1000);
exponents = [2 0 0; 0 2 0; 0 0 2; 0 0 0];
coefficients = [a; b; c; d];
cA = zeros([3 3 3]);
cA(1,3,3) = a;
cA(3,1,3) = b;
cA(3,3,1) = c;
cA(3,3,3) = d;
assert(isequal(coeffArray(exponents,coefficients),cA))
M =
4
V =
3
|
6 | Pass |
coefficients = randi(1000);
nVars = randi(20)+1;
exponents = ones(1,nVars);
cA = zeros(2*ones(1,nVars));
cA(1) = coefficients;
assert(isequal(coeffArray(exponents,coefficients),cA))
M =
1
V =
14
|
Calculate the Hamming distance between two strings
178 Solvers
Relative ratio of "1" in binary number
392 Solvers
Find the index of n in magic(n)
160 Solvers
56 Solvers
171 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!