Create a row vector a and a column vector b, then multiply them. The 1-by-3 row vector and 6-by-1 column vector combine to produce a 6-by-3 matrix with all combinations of elements multiplied.

A — Left array scalar | vector | matrix | multidimensional array

Left array, specified as a scalar, vector, matrix, or multidimensional
array. Numeric inputs A and B must
either be the same size or have sizes that are compatible (for example, A is
an M-by-N matrix and B is
a scalar or 1-by-N row vector).
For more information, see Compatible Array Sizes for Basic Operations.

If A and B are datetime,
duration, or calendar duration arrays, then they must be the same
size unless one is a scalar.

B — Right array scalar | vector | matrix | multidimensional array

Right array, specified as a scalar, vector, matrix, or multidimensional
array. Numeric inputs A and B must
either be the same size or have sizes that are compatible (for example, A is
an M-by-N matrix and B is
a scalar or 1-by-N row vector).
For more information, see Compatible Array Sizes for Basic Operations.

If A and B are datetime,
duration, or calendar duration arrays, then they must be the same
size unless one is a scalar.

Tall Arrays Calculate with arrays that have more rows than fit in memory.

This function fully supports tall arrays. For
more information, see Tall Arrays.

C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.

Usage notes and limitations:

Multiplication of pure imaginary numbers by non-finite
numbers might not match MATLAB^{®}. The code generator does not specialize
multiplication by pure imaginary numbers—it does not eliminate
calculations with the zero real part. For example, (Inf +
1i)*1i = (Inf*0 – 1*1) + (Inf*1 + 1*0)i = NaN + Infi.

GPU Arrays Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.