MatLab command that will return a matrix that contains the product of every element in two vectors of any length

For example
V1 = [10, 20, 30]
V2 = [2, 3, 6]
and the return should be something like
ANS = [20, 40, 60;
30, 60, 90;
60, 120, 180]
I tried to do v1 .* v2 and the return is something like ans= 20 60 180 which is not what I want... any suggestion? thank you

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 30 Nov. 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by