however, in doing so I am getting the following error:
Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your
available stack space can crash MATLAB and/or your computer.
How to resolve this error
Could you share the mtx files? Please send me p.m. at gpapazafeiropoulos@yahoo.gr
Dear Sir,
I am trying to obtain mass and stiffness matrices from getmatrix.m code.
I am attaching matlab code below:
file={'Quadratic_STIF2(1).mtx';
'Quadratic_MASS2(1).mtx';};
abqDir=('E:\New folder');
for i=1:2
mtxFile=file{i};
Mout = getMatrix(mtxFile,'sparse',abqDir)
end
The error is as follows:
Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your
available stack space can crash MATLAB and/or your computer.
Error in getMatrix
I shall be very thankful if you can resolve the issue.
Dear Nikhil,
Usually, this error occurs because you have a function that is calling itself, resulting in an infinite recursion. MATLAB terminates recursion after RecursionLimit iterations.
Some preliminary operations that would either solve or shed some light on the cause of the problem are the following:
1) Check if there is a variable the name of which coincides with a Matlab function. For example, you should not use mean as a variable, since there is a Matlab function mean.m.
2) Check if you call a subfunction of your code inside itself.
It is better to re-design you algorithm to reduce recursion as much as possible. However, if you can paste here the complete error message (the red text including the parts that identify the line of code throwing the error), this would greatly help us in identifying the source of the error, as well as its fixing.