dot
Prev | Orchestra Opcodes and Operators | Next

## dot

dot — Calculates the dot product of two arrays.

## Description

Takes two numeric arrays (k or i-rate) and calculates the dot product.

## Syntax

    kres/ires dot karr1[]/iarr1[], karr2[]/iarr2[]   (k- or i-arrays )

## Examples

Here is an example of the dot opcode. It uses the file dota.csd.

Example 241. Example of the dot opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

    <CsoundSynthesizer>
    <CsOptions>
    -n
    </CsOptions>
    <CsInstruments>

    instr 1
     kArr1[] fillarray 1,3,2,7,4
     kArr2[] fillarray 2,3,1,2,5
     kd dot kArr1,kArr2
     printk2 kd
     turnoff
    endin

    </CsInstruments>
    <CsScore>
    i1 0 1
    </CsScore>
    </CsoundSynthesizer>

## See Also

sumarray product

## Credits

Author: Victor Lazzarini

New in version 6.09

Prev | Up | Next
doppler | Home | downsamp