| Variable | R Documentation |
Constructs a variable to be used in a CVXR optimization problem. Variables are decision variables that the solver optimizes over.
Variable(shape = c(1L, 1L), name = NULL, var_id = NULL, latex_name = NULL, ...)
shape |
Integer vector of length 1 or 2 giving the variable dimensions.
A scalar |
name |
Optional character string name for the variable. If |
var_id |
Optional integer ID. If |
latex_name |
Optional character string giving a custom LaTeX name for
use in visualizations. For example, |
... |
Additional attributes: |
A Variable object (inherits from Leaf and
Expression).
x <- Variable(3) # 3x1 column vector
X <- Variable(c(2, 3)) # 2x3 matrix
y <- Variable(2, nonneg = TRUE) # non-negative variable
z <- Variable(3, name = "z", latex_name = "\\mathbf{z}") # custom LaTeX
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.