Use eval()
:
var = eval(strcat('x','a'));
It will “evaluate” the string 'xa'
and translate it to the value of the variable xa
.
Source : MATLAB documentation
More Related Contents:
- How to interpolate with MATLAB 3D usind scatteredinterpolant plot? [closed]
- Matlab how to save a modified image from axes [closed]
- Is it possible to define more than one function per file in MATLAB, and access them from outside that file?
- How to get all files under a specific directory in MATLAB?
- Matlab: Running an m-file from command-line
- Loop through files in a folder in matlab
- Hash tables in MATLAB
- Find given row in a matrix
- Use a vector as an index to a matrix
- How to concatenate a number to a variable name in MATLAB?
- Suppressing a function’s command window output
- Align already captured rgb and depth images
- How to normalize / denormalize a vector to range [-1;1]
- How do I get the second return value from a function without using temporary variables?
- Matlab Template Matching Using FFT
- Sorting entire matrix according to one column in matlab
- How to generate a non-linear colormap/colorbar?
- how to count unique elements of a cell in matlab?
- How can I save an altered image in MATLAB?
- What are the semantics of ‘end’ in Matlab?
- Generate and plot the empirical joint pdf and CDF [closed]
- Setting graph figure size
- How do I detect if I’m running MATLAB or Octave?
- What is a spectrogram and how do I set its parameters?
- In Matlab, is it possible to terminate a script, but save all its internal variables to workspace?
- Machine learning – Linear regression using batch gradient descent
- How to nest multiple parfor loops
- Extract arbitrarily rotated plane of data from 3D array as 2D array
- Select largest object in an image
- Efficiently compute a 3D matrix of outer products – MATLAB