Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Create a vector from 0 to 10 with a step of 1 using the colon operator.
Remember the format is `start:step:end`.
What would A(1:2, :) return if A is a 3x3 matrix?
Think about row selection with the colon operator.
What is the purpose of the colon operator in MATLAB?
Think of how you might want to list numbers.
True or False: The command A(:, 3) = [] removes the third row.
Remember the syntax of indexing.
Create a matrix of size 5x5, filled with the numbers 1 to 25. Then, using the colon operator, extract the submatrix containing rows 3 to 5 and columns 4 to 5.
Think about how to reshape a vector into a matrix before extracting.
Suppose you have a matrix M. Using the colon operator, write a command to retrieve the last two rows and all columns of M and set them to zero.
Think about how 'end' can help you find the last rows.
5 more questions in this section. Enroll free to practise them all.
Enroll free