consider the numbers 1, 2, 3. enter these as components of a column vector and as components of a row vector. in matlab

To create a column vector with the numbers 1, 2, and 3 as components in MATLAB, you can use the following code:

main.m
column_vector = [1; 2; 3];
27 chars
2 lines

To create a row vector with the numbers 1, 2, and 3 as components, you can use the following code:

main.m
row_vector = [1, 2, 3];
24 chars
2 lines

In a row vector, the numbers are separated by commas, whereas in a column vector, they are separated by semicolons.

related categories

gistlibby LogSnag