MATLAB Function Reference
  Go to function:
    Search    Help Desk 
evalin    See Also

Evaluate expression in workspace

Syntax

Description

evalin(ws,'expression') evaluates expression in the context of the workspace ws. ws can be either 'caller' or 'base'.

[X,Y,Z,...} = evalin(ws,'expression') returns output arguments from the expression.

evalin(ws,'try','catch') tries to evaluate the try expression and if that fails it evaluates the catch expression in the specified workspace.

evalin is useful for getting values from another workspace while assignin is useful for depositing values into another workspace.

Limitation

evalin may not be used recursively to evaluate an expression, i.e., a sequence of the form evalin('caller','evalin(''caller'',''expression'')') doesn't work.

See Also

assignin    Assign variable in workspace.

eval        Interpret strings containing MATLAB expressions



[ Previous | Help Desk | Next ]