MATLAB: Do I receive an error when using the LIMIT function to determine the limit of a vector of symbolic equations within the Symbolic Math Toolbox

insufficientlimitoutputssymsymbolicSymbolic Math Toolbox

For example, when I execute the following command:
syms s
v = [1/s; s; 1/s];
L = limit(v, 0);
I receive the following error message:
??? Insufficient outputs from right hand side to satisfy comma separated
list expansion on left hand side. Missing [] are the most likely cause.

Best Answer

This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
This has been verified as a bug in the LIMIT function within the Symbolic Math Toolbox in the way it handles vectors of undefined limits.
Currently, to work around this issue, you can make a slight modification to the sym/limit.m file by performing the following steps.
1) Open sym/limit.m by typing
edit sym/limit
in the MATLAB Command Window.
2) Save this file as "limit.m.old".
3) Change the last line of the function from:
if ~isempty(k), r(k).s = 'NaN'; end
to:
if ~isempty(k), [r(k).s] = deal('NaN'); end
4) Save this file as "limit.m".