Hadamard_Matrix {HadamardR} | R Documentation |
Hadamard_Matrix
Description
Hadamard_Matrix is generic function for construction of Hadamard matrix.
Usage
Hadamard_Matrix(order)
Arguments
order |
integer |
Details
function Hadamard_matrix was created which does not require known of construction methods. Hadamard_matrix() takes an integer as input and returns Hadamard matrix if it is available. In case, it is not possible to construct, NULL value is returned.
Value
Hadamard Matrix of given Order
Examples
Hadamard_Matrix(1)
#1
Hadamard_Matrix(2)
# [,1] [,2]
# [1,] 1 1
# [2,] 1 -1
Hadamard_Matrix(8)
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
# [1,] 1 1 1 1 1 1 1 1
# [2,] 1 -1 1 -1 1 -1 1 -1
# [3,] 1 1 -1 -1 1 1 -1 -1
# [4,] 1 -1 -1 1 1 -1 -1 1
# [5,] 1 1 1 1 -1 -1 -1 -1
# [6,] 1 -1 1 -1 -1 1 -1 1
# [7,] 1 1 -1 -1 -1 -1 1 1
# [8,] 1 -1 -1 1 -1 1 1 -1
Hadamard_Matrix(10)
#"Order is not a Hadamard number"
Hadamard_Matrix(668)
#"Not possible to construct or order is not a multiple of 4"
[Package HadamardR version 1.0.0 Index]