Assignin
Assign value to variable in specified workspace
Syntax
Assignin (WS, ' Var ', Val)
Description
Assignin (WS, ' Var ', Val) assigns the value Val to the variable var in the workspace ws. The Var input must is the array name only; It cannot contain array indices. If var does not exist in the specified workspace, Assignin creates it. WS can has a value of ' base ' or ' caller ' to denote the MATLAB base workspace or the workspace of the caller function.
The Assignin function is particularly useful for these tasks:
Exporting data from a function to the MATLAB workspace
Within a function, changing the value of a variable that's defined in the workspace of the caller function (such as a Var Iable in the function argument list)
Evalin
Execute MATLAB expression in specified workspace
Syntax
Evalin (WS, Expression)
[A1, A2, A3, ...] = Evalin (ws, Expression)
Description
Evalin (WS, expression) executes expression, a string containing any valid MATLAB expression, in the context of the WORKSPA Ce ws. WS can has a value of ' base ' or ' caller ' to denote the MATLAB base workspace or the workspace of the caller function. You can construct expression by concatenating substrings and variables inside square brackets:
expression = [string1, Int2str (Var), string2,...]