MATLAB: Maximum recursion limit of 500 reached error in matlab.

matrix generation

I have downloaded matlab file "Random vectors with fixed sum" I got 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.
Error in randfixedsum
I attach file Random vectors with fixed sum. how to solve this error.

Best Answer

Remove the three lines you added,
m=6;n=6; a=0.3; b=0.5;s=2
[x,v] = randfixedsum(n,m,s,a,b)
set(0,'RecursionLimit',N)
Now in a different .m file, put in
m=6;n=6; a=0.3; b=0.5;s=2
[x,v] = randfixedsum(n,m,s,a,b)