title: Find & rename variable in workspace, if either names exist
body: <p>How could I search for a variable name in Workspace from a list of possible names &amp; then rename the existing variable and use its data. </p>
  
  <p>Example:  </p>
  
  <pre><code>A_apple_tree = [2;2;1;4];
  AppleTree = [2;2;1;4];
  Apple_tree_a5 = [2;2;1;4];
  </code></pre>
  
  <p>are the same variable with different names. 
  I'd like to scan through Workspace variables until it finds one, then rename it to, say:</p>
  
  <pre><code>Apple_Tree = [2;2;1;4];
  </code></pre>
  
  <p>The below code displays variables with partial string search, however the found variables names are contained in a cell array. Using <code>cell2mat</code> will convert the cell containing the variable name into char with no values. </p>
  
  <pre><code>namesWorkspace = who;
  outStr = regexpi(namesWorkspace, 'apple');
  ind = ~cellfun('isempty',outStr);
  vars = namesWorkspace(ind);
  Apple_Tree = cell2mat(vars);
  
  Apple_Tree = 'apple_tree_a5' %%%..... instead of values for apple_tree_a5;
  </code></pre>
  
  <p>How could I call the existing variable with its data for later purposes? </p>
  
  <p>Thank you,</p>