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))
|
3 | Pass |
coefficients = randi(1000,[10 1]);
exponents = (9:-1:0)';
cA = coefficients;
assert(isequal(coeffArray(exponents,coefficients),cA))
|
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))
|
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))
|
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))
|
Return a list sorted by number of occurrences
1225 Solvers
Create a cell array out of a struct
189 Solvers
299 Solvers
54 Solvers
Compute a dot product of two vectors x and y
645 Solvers