Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
Write the command to extract rows 1 and 2 from matrix A.
Use brackets to specify row indices.
What does A(:, 1) return for matrix A?
Remember the colon operator selects all rows.
What is the syntax to create a sub-matrix from rows 1 and 3, and columns 2?
Look for the correct use of list syntax for indices.
True or False: You can use a colon operator to reference all elements in a column.
Consider how data selection works in sections.
Given matrix D = [3 1 4; 1 5 9; 2 6 5], write code to create a sub-matrix that includes all rows but only the first two columns.
Focus on how to include all rows and only apply a range to the columns.
If you have a matrix E = [1 2 3; 4 5 6; 7 8 9; 10 11 12], how would you extract a sub-matrix containing rows 3 to 4 and columns 1 to 2?
Identify which rows to select and which columns to slice from.
5 more questions in this section. Enroll free to practise them all.
Enroll free