uncover the call structure of a recursive function call

Version 1.0.0 (3.5 KB) by Thomas
recurse(tree) helps to uncover the call structure of a recursive function call.
14 Downloads
Updated Sat, 11 Jul 2020 22:34:23 +0000

View License

The recursive function to examine shall be y = f(x) , then the first call of f must be modified to: [y,tree] = f( x , recurse() ).
When f recursively calls itself use: y = f( x, recurse(tree) )
The call structure of f will be traced in an adjacency matrix "tree.glo.adjacency" by calling recurse(tree) together with f. The adjacency matrix can be plotted as a directed graph using the method RecursionStructure(tree).
As an example see the use of recurse(tree) in the karatsuba function.
run: "karatsubatest" in order to multiply two large integers using the karatsuba method.

Cite As

Thomas (2024). uncover the call structure of a recursive function call (https://www.mathworks.com/matlabcentral/fileexchange/78044-uncover-the-call-structure-of-a-recursive-function-call), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2019a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0