Cody

# Problem 43597. Solve the following system of equations.

Solution 1575443

Submitted on 4 Jul 2018
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
a=7 y_correct = [2; -1; 1]; assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

a = 7

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in solveSystem (line 12) res = b * inv(A) % ? Error in Test1 (line 3) assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

2   Fail
a=10 y_correct = [1.2; -0.8; 2.4]; assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

a = 10

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in solveSystem (line 12) res = b * inv(A) % ? Error in Test2 (line 3) assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

3   Fail
a=-4 y_correct = [4.9333; -1.7333; -4.1333]; assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

a = -4

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in solveSystem (line 12) res = b * inv(A) % ? Error in Test3 (line 3) assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

4   Fail
a=42 y_correct = [-7.3333; 1.3333; 17.3333]; assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

a = 42

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in solveSystem (line 12) res = b * inv(A) % ? Error in Test4 (line 3) assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

5   Fail
a=11 y_correct = [0.9333; -0.7333; 2.8667]; assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

a = 11

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in solveSystem (line 12) res = b * inv(A) % ? Error in Test5 (line 3) assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

6   Fail
a=-100 y_correct = [30.5333; -8.1333; -48.9333]; assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

a = -100

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in solveSystem (line 12) res = b * inv(A) % ? Error in Test6 (line 3) assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

7   Fail
a=71 y_correct = [-15.0667; 3.2667; 30.8667]; assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

a = 71

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in solveSystem (line 12) res = b * inv(A) % ? Error in Test7 (line 3) assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

8   Fail
a=1e4 y_correct = [-2662.8; 665.2; 4664.4]; assert(sum(abs(solveSystem(a)-y_correct))<1e-3)

a = 10000

Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise multiplication, use '.*'. Error in solveSystem (line 12) res = b * inv(A) % ? Error in Test8 (line 3) assert(sum(abs(solveSystem(a)-y_correct))<1e-3)