MATLAB: W = evalin(‘caller’,’who global’) returns an error

evalinglobal

The command
evalin('caller','who global')
correctly returns the global variables in the caller workspace, but
W = evalin('caller','who global')
returns the error message
Error: illegal use of the reserved keyword global
Yet the syntax of the line that throws the error is consistent with the prescribed use of evalin. Is this a bug? What's the workaround? Thanks

Best Answer

W = evalin('caller','who("global")')