Uses of Column Vectors
One of the uses of column vectors is for multiplying row vectors.
Consider the case when we are given two row vectors and we need to find their product. Since they are both row vectors, it is impossible to calculate their product as their dimensions are not compatible. So, we would change one of them to a column vector and then we can compute their product.
Example 3:
Matlab
% MATLAB Code for % Two row vectors vecA = 1:8; vecB = 5:12; % Converting vecB into a column vector vecB = vecB'; % Calculating the product of column % vector vecB and row vector vecA prod = vecB*vecA; disp(prod) |
Output:
Column Vectors in MATLAB
Column vectors are vectors that have a single column but, multiple rows. MATLAB provides various functions that use column vectors as their arguments. In this article, we will see different methods of creating and using column vectors in MATLAB.