0
0
MATLABdata~5 mins

Row and column vectors in MATLAB - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a row vector in MATLAB?
A row vector is a 1-by-n matrix, meaning it has 1 row and multiple columns. For example, [1 2 3] is a row vector with 3 elements.
Click to reveal answer
beginner
What is a column vector in MATLAB?
A column vector is an n-by-1 matrix, meaning it has multiple rows and 1 column. For example, [1; 2; 3] is a column vector with 3 elements.
Click to reveal answer
beginner
How do you create a row vector with elements 4, 5, and 6 in MATLAB?
You write the elements separated by spaces or commas inside square brackets: v = [4 5 6];
Click to reveal answer
beginner
How do you create a column vector with elements 4, 5, and 6 in MATLAB?
You write the elements separated by semicolons inside square brackets: v = [4; 5; 6];
Click to reveal answer
beginner
What is the difference between a row vector and a column vector in MATLAB?
A row vector has one row and many columns, written as [a b c]. A column vector has many rows and one column, written as [a; b; c]. They look different and behave differently in operations.
Click to reveal answer
Which of the following is a row vector in MATLAB?
A[1; 2; 3]
B[1 2 3]
C[1, 2; 3, 4]
D[1; 2, 3]
How do you separate elements to create a column vector in MATLAB?
AWith spaces
BWith commas
CWith semicolons
DWith periods
What is the size of a row vector with 5 elements?
A1-by-5
B5-by-1
C5-by-5
D1-by-1
What is the size of a column vector with 4 elements?
A1-by-1
B1-by-4
C4-by-4
D4-by-1
Which MATLAB code creates a column vector?
Av = [7; 8; 9];
Bv = [7 8 9];
Cv = [7, 8, 9];
Dv = [7 8; 9 10];
Explain how to create row and column vectors in MATLAB and how they differ.
Think about how elements are separated inside square brackets.
You got /4 concepts.
    Describe the size (dimensions) of row and column vectors and why it matters.
    Remember rows and columns count.
    You got /4 concepts.