assign
Assign a value to a variable by name.
Syntax
Section titled “Syntax”v = assign(lhs, rhs)Description
Section titled “Description”Assigns rhs to the variable named lhs (a string) in the caller’s workspace. Equivalent to evaluating <lhs> = <rhs> via eval but avoids the parser overhead. Returns the assigned value.
Example
Section titled “Example”assign('x', 42); % equivalent to: x = 42;