Solve a System of Linear Equations - MATLAB Cody - MATLAB Central

Problem 44946. Solve a System of Linear Equations

Difficulty:Rate
Example:
If a system of linear equations in x₁ and x₂ is:
2x₁ + x₂ = 2
x₁ - 4 x₂ = 3
Then the coefficient matrix (A) is:
2 1
1 -4
And the constant vector (b) is:
2
3
To solve this system, use mldivide ( \ ):
x = A\b
Problem:
Given a constant input angle θ (theta) in radians, create the coefficient matrix (A) and constant vector (b) to solve the given system of linear equations in x₁ and x₂.
cos(θ) x₁ + sin(θ) x₂ = 1
-sin(θ) x₁ + cos(θ) x₂ = 1

Solution Stats

55.09% Correct | 44.91% Incorrect
Last Solution submitted on Mar 28, 2025

Problem Comments

Solution Comments

Show comments
Who Deserves Your Praise? Discover the New Contribution Widget!
...
We are excited to announce another update to our Discussions area: the...

Problem Recent Solvers12713

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!
Go to top of page