Cody

# Problem 44705. Expand 10^n to Powers of 4

Solution 2950003

Submitted on 15 Sep 2020
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   Fail
n = 0; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

2   Fail
n = 1; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

3   Fail
n = 2; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

4   Fail
n = 3; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

5   Fail
n = 4; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

6   Fail
n = 5; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

7   Fail
n = 6; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n)& isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

8   Fail
n = 7; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

9   Fail
n = 8; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

10   Fail
n = 9; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

11   Fail
n = 10; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

12   Fail
n = 11; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

13   Fail
n = 12; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

14   Fail
n = 13; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

15   Fail
n = 14; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

16   Fail
n = 15; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end))&coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

17   Fail
n = 16; coeff = ten2pow4(n); assert(isequal(dot(coeff, 4.^flip(0:n)),10^n) & isequal(coeff(1),coeff(end)) & coeff(1)>0)

Error in solution: Line: 11 Column: 36 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!