Symbolic diagonal matrix

diag_(x, n = 1L, declare_symbols = TRUE, ...)

Arguments

x

Character vector with diagonal

n

Number of times x should be repeated

declare_symbols

Passed on to as_sym() when constructing symbolic matrix

...

Passed on to rep(x, n, ...)

Examples

if (has_sympy()) { diag_(c("a", "b", "c")) diag_("a", 2) }
#> [caracas]: ⎡a 0⎤ #> ⎢ ⎥ #> ⎣0 a⎦