What does this error mean in the command window: "Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit" ?
8 ビュー (過去 30 日間)
古いコメントを表示

How do I change the limit if I want to send this email?
0 件のコメント
回答 (1 件)
Rik
2018 年 8 月 6 日
You actually blotted out the most import part of your code, as the rest is never reached. You run a function that calls itself. That's fine of course, but you must have a method to escape the loop. A classic example is the factorial function:
function answer=my_factorial(val)
if val==1
answer=1;
else
answer=val*my_factorial(val-1);
end
end
See how it makes sure there is an end to this recursion? You need to incorporate that in your function as well.
1 件のコメント
Walter Roberson
2018 年 8 月 6 日
Perhaps that line was intended to be a comment as a documentation example.
参考
カテゴリ
Help Center および File Exchange で Web Services についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!