How to count the number of recursive calls

How exactly would i count the number of recursions that my function has made? For example, if i were counting the number of times i had to recurse while trying to find the a factorial?

Answers (1)

Adam
Adam on 26 Mar 2015
Keep incrementing a counter and pass it down into the function as an argument.

Tags

Asked:

on 26 Mar 2015

Answered:

on 26 Mar 2015

Community Treasure Hunt

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

Start Hunting!