Description Usage Arguments Details Value Examples
View source: R/Hadamard_matrix.R
Hadamard_Matrix is generic function for construction of Hadamard matrix.
1 |
order |
integer |
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.
Hadamard Matrix of given Order
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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"
|
[1] 1
[,1] [,2]
[1,] 1 1
[2,] 1 -1
[,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
[1] "Order is not a Hadamard number"
[1] "Not possible to construct or order is not a multiple of 4"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.