Cody

Problem 44946. Solve a System of Linear Equations

Solution 3000874

Submitted on 28 Sep 2020 at 8:11
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
theta = 2*pi; x_correct = [1; 1]; assert(sum(abs((solve_lin(theta)-x_correct)))< 1e-5)

Undefined function 'con' for input arguments of type 'double'. Error in solve_lin (line 2) A=[cos(theta) sin(theta);-sin(theta) con(theta)] Error in Test1 (line 3) assert(sum(abs((solve_lin(theta)-x_correct)))< 1e-5)

2   Fail
theta = pi; x_correct = [-1; -1]; assert(sum(abs((solve_lin(theta)-x_correct)))< 1e-5)

Undefined function 'con' for input arguments of type 'double'. Error in solve_lin (line 2) A=[cos(theta) sin(theta);-sin(theta) con(theta)] Error in Test2 (line 3) assert(sum(abs((solve_lin(theta)-x_correct)))< 1e-5)

3   Fail
theta = -0.5; x_correct = [1.357;0.3982]; assert(sum(abs((solve_lin(theta)-x_correct)))< 1e-4)

Undefined function 'con' for input arguments of type 'double'. Error in solve_lin (line 2) A=[cos(theta) sin(theta);-sin(theta) con(theta)] Error in Test3 (line 3) assert(sum(abs((solve_lin(theta)-x_correct)))< 1e-4)

Suggested Problems

More from this Author13

Community Treasure Hunt

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

Start Hunting!