MATLAB: Do I receive the error message: “??? Unable to find subsindex function for class char”

MATLAB

??? Unable to find subsindex function for class char
??? Unable to find subsindex function for class struct
??? Unable to find subsindex function for class cell
In MATLAB 6.1 and previous versions, I can reproduce this error message using the following code:
set='abc'
set(gcf,'position')

Best Answer

This error occurs when a variable has the same name as a MATLAB function. For example, this error would occur if a variable in my MATLAB code was named SET, which is also a MATLAB function.
To determine if a particular variable is also a MATLAB function, you can use the which -all command. For example:
which set -all
If it outputs both a variable name and a filename that is under the MATLAB path, then you will need to rename your variable.