MATLAB: How to multiply a 1xn matrix with a 1xn matrix and get the answer in the form of a 1xn matrix

MATLABmatlab vector function code equation matrix

a have the following matrices:
a= [1 5 3 8]
and
b= [4 6 1 9]
how do i multiply each term in a by the equivalent term of the other matrix in b?
so the answer would be:
ab= [4 30 3 72]
I'm really stuck, I've been transposing them but it obviously just gives me one numerical answer..
help!

Best Answer

ab = a .* b; % Note the dot asterisk, dot meaning element-wise