Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to solve the system Ax = b.
MATLAB
x = A [1] b; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using * instead of \ to solve the system.
Using / which is for right division, not solving Ax = b.
✗ Incorrect
In MATLAB, the backslash operator \ solves the system Ax = b efficiently.
2fill in blank
mediumComplete the code to solve the system and store the result in variable x.
MATLAB
x = [1] \ b; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting b before the backslash operator.
Using inv(A) which is less efficient and not recommended.
✗ Incorrect
The matrix A is on the left side of the backslash operator to solve Ax = b.
3fill in blank
hardFix the error in the code to correctly solve the system Ax = b.
MATLAB
x = A [1] b; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using / which performs right division, not solving the system.
Using * which multiplies matrices but does not solve equations.
✗ Incorrect
The correct operator to solve Ax = b is the backslash \, not division or multiplication.
4fill in blank
hardComplete the code to create a matrix of solutions for multiple right-hand sides.
MATLAB
solutions = A [1] b(:, :); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using * instead of \ to solve the system.
Using , instead of : to select all rows.
✗ Incorrect
Use \ to solve the systems for all columns of b and : to select all rows and columns of b.
5fill in blank
hardFill all three blanks to solve and store solutions for each column of b in an array.
MATLAB
for [1] = 1:size(b, 2) solutions([2]) = A [3] b(:, i); end
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using * instead of \ to solve the system.
Using a different variable name than the loop index.
✗ Incorrect
Use i as the loop variable and index, and \ to solve the system.