create a column vector 𝑡 containing the values in the first column of the matrix in matlab

You can create a column vector containing values of the first column of a matrix A by indexing it as A(:,1). For example, suppose A is a matrix of size [3 2] with the following elements:

main.m
A = [1 4
     2 5
     3 6]
28 chars
4 lines

To create a column vector containing the values of the first column of A, you can use the command:

main.m
t = A(:,1)
11 chars
2 lines

This will create a column vector t of size [3 1] with the following elements:

main.m
t = [1
     2
     3]
22 chars
4 lines

related categories

gistlibby LogSnag