Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hadamard

Hadamard Matrix


Description

Generate Hadamard matrix of a certain size.

Usage

hadamard(n)

Arguments

n

An integer of the form 2^e, 12*2^e, or 20*2^e

Details

An n-by-n Hadamard matrix with n>2 exists only if rem(n,4)=0. This function handles only the cases where n, n/12, or n/20 is a power of 2.

Value

Matrix of size n-by-n of orthogonal columns consisting of 1 and -1 only.

Note

Hadamard matrices have applications in combinatorics, signal processing, and numerical analysis.

See Also

Examples

hadamard(4)
H <- hadamard(8)
t(H)

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.