cyclic_matrix | R Documentation |
This helper function creates a symmetric matrix from a given vector v
.
cyclic_matrix(v)
v |
A numeric vector. |
This function creates a symmetric matrix for a given vector v
.
If v = \{v_{0}, v_{1} , \dots , v_{N-1} , v_{N} \},
then the symmetric matrix will has the form
\left[ {\begin{array}{ccccc}
v_{0} & v_{1} & \cdots & v_{N - 1} & v_{N} \\
v_{1} & v_{0} & \cdots & v_{N - 2} & v_{N - 1} \\
\vdots & \vdots & \ddots & \vdots & \vdots \\
v_{N - 1} & v_{N- 2} & \cdots & v_{0} & v_{1} \\
v_{N} & v_{N - 1} & \cdots & v_{1} & v_{0} \\
\end{array}} \right]
A symmetric matrix.
v <- c(1, 2, 3)
cyclic_matrix(v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.