Mul2 Function

Mul2 multiplies all values in a list by each value in the other list


Function

The function Mul2 is used to multiply two lists. Each element of the first list is multiplied by each element of the second list. The result is a table. The size of the table corresponds to the lengths of the list a * list b.

For a simple calculation, the expression x=Mul2(a,b) is identical tox[]=a·b.

For more complex expressions with more than two lists in the arguments, the use of the function Mul2 can be required. The differences are shown below.

Available from version 7.12


Syntax

Mul2 (a, b)

Example



In the following example, each line of the result of Mul2(a,b) is added to each element of c.
The result is a table with 3 lines.



In the following example, each element of a is multiplied by each element of b. then each element of c is added to each element of the resulting table. The result is a three-dimensional data field. The index display shows three consecutive tables.

Practical example

In the following example, the resonance frequency is calculated from three different capacitances C and inductances L. The result is a table containing the results of all possible combinations.