Limit of nested parentheses in MATLAB

10 views (last 30 days)
Tiasa Ghosh
Tiasa Ghosh on 22 Aug 2018
Commented: Tiasa Ghosh on 22 Aug 2018
Hello all, I just wanted to know the limit of nested brackets and parentheses in MATLAB. I have some equations with more than 20 brackets and parentheses nesting. Initially it was around 60 and after reading the question in this link, https://de.mathworks.com/matlabcentral/answers/291976-avoid-depth-limit-for-nested-parenthesis-and-brackets, I reduced it to 30 parentheses but still I still get the error Parentheses, brackets, and braces are nested too deeply.
So does anybody know the actual limit of nesting?
  4 Comments
Tiasa Ghosh
Tiasa Ghosh on 22 Aug 2018
The error shows up like this: errmsg =
'Error using str2sym (line 83)
Unable to convert string to symbolic expression:
L 1 (C 158): MDEEP: Parentheses, brackets, and braces are nested too deeply.'
msgid =
'symbolic:str2sym:UnableToConvert'
Error using str2sym (line 83)
Unable to convert string to symbolic expression:
L 1 (C 116): MDEEP: Parentheses, brackets, and braces are nested too deeply.
I am integrating a wind turbine model from Modelica with a MATLAB toolbox for my purpose and the equations are generated from matrix multiplication for wind turbine model in Modelica. So in Modelica actually what it does is define two matrices with the dimensions and when the model is simulated , the arithmetical operations are done to output the equations. So the equations are not hardwired into the model but are generated while the model is being simulated by Modelica.

Sign in to comment.

Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by