given a = [1; 2; 3]; b = [4; 5; 6];, fi nd the array product of the two vectors. in matlab

In MATLAB, the array product of two vectors can be obtained using the .* operator. To find the array product of a and b, you can simply do:

main.m
a = [1; 2; 3];
b = [4; 5; 6];
array_product = a .* b
53 chars
4 lines

This will return an output of:

main.m
array_product =

     4
    10
    18
38 chars
6 lines

The .* operator performs element-wise multiplication of the two vectors.

related categories

gistlibby LogSnag