%% Define a row vector vec1 with three elements: 1, 2, and 3
vec1 = [1 2 3];

% Define a 3x3 matirx mat1 with elements from 1 to 9
mat1 = [1:3; 4:6; 7:9];

%or
mat1 = [1 2 3; 4 5 6; 7 8 9];

% Find the product of the matrix and the vector

vec1 * mat1


% If matrix goes first, then the row-vector must be transposed
mat1 * vec1'  