MATLAB: Display variables in the Workspace from script

MATLABprogramming

Suppose I have a variable
x=1;
I want to have a script that displays this variable in the workspace (see attached.) Please advise.

Best Answer

openvar('x')