ChalksetMake your own — free

Shared set · @asarrett · MATLAB / Introductory Programming (EGR 219 Onramp)

MATLAB Fundamentals: Variables, Scripts, Vectors, and Matrices

Topics drawn from a student's MATLAB Onramp reflection notes (variable recalculation, comments, error messages, vectors and matrices); questions are written from standard MATLAB fundamentals.

Save a copy to my library — freeOpen in Chalkset 17 questions with worked explanations. Or make your own from your notes — the first draft needs no account.

Try the first 5 cards

1 of 17
Given B = [10,20,30;40,50,60], what does B(1,3) return?
tap to reveal the answer
2 of 17
Given A = [1,2,3;4,5,6;7,8,9], what does the command A(:,2) = [] do to A, and what is the resulting size?
tap to reveal the answer
3 of 17
If you accidentally write A(3,2) intending to get row 2, column 3 of a matrix A, what mistake have you made and what will actually be returned?
tap to reveal the answer
4 of 17
For the matrix M = [3,6,9;12,15,18], what does size(M) return, and what does size(M,2) return?
tap to reveal the answer
5 of 17
What is a matrix, in terms of rows and columns, and how is [1,2;3,4;5,6] classified (size and shape)?
tap to reveal the answer

12 more in the set. Keep going in Chalkset — each card is scheduled on its own, so the ones you miss come back sooner.

Also in this set

  1. Given v = [7, 14, 21, 28, 35], what does v(end) return, and what does v(end-1) return?
  2. If r = [1, 2, 3] is a row vector, what does r' (r followed by an apostrophe) produce, and what is its size?
  3. What does the command x = 2:3:14 produce, and how many elements does it contain?
  4. You type a variable name that was never created (e.g., due to a typo) into the Command Window. What happens, and what color does MATLAB typically use to flag it?
  5. In the MATLAB editor, where do you look to quickly locate a line with an error, and how do you see the actual error message?

and 7 more — open the set to see every question and its worked explanation.