SUBVAR(S,OLD,NEW) replaces OLD with NEW in the expression S.
OLD is a string or cell of strings representing variable names to be substituted by NEW in the expression S.
Only variables defined as using SYMVAR are substituted. That is in expressions like 'f(1)', SUBVAR interprets the symbol 'f' as a function call, not as an index into a symbolic variable.
Per-Anders Ekstrom (2020). subvar (https://www.mathworks.com/matlabcentral/fileexchange/13832-subvar), MATLAB Central File Exchange. Retrieved .