How to get the selected variable in the workspace ?

40 views (last 30 days)
Hi ! I want to get the selected variable in the workspace.
I know that openvar function is double-click a variable in the Workspace browser, but I am looking for the simple click function (the selected variable).
Thanks for your help.
JC CJ on 5 Nov 2012
Edited: JC CJ on 5 Nov 2012
No, I don't want to open it in the variable editor
For example, I select variable var1 in my workspace with one click on it. Its name 'var1' now appears in white over blue in the workspace. Then I am looking for the following function:
selected_variable = get_selected_variable_in_workspace_function();
% then I use it like:
Is it clearer ? Does this get_selected_variable_in_workspace_function exit in Matlab ?

Sign in to comment.

Answers (1)

Arthur on 5 Nov 2012
I'm not aware of any such function. However, you can simply drag and drop the variable in the command window.
If it's for plotting only: simply hit the plot button.



Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by