Writing a Recursive Function
Show older comments
I am having trouble writing a recursive function that calculates the value of N(i,p)
for example, to calculate N(0,2), I need the values of N(0,1) and N(1,1). Then each of those will need the values of the lower nodes in the tree as shown below. The value of any N(i,0)=1.

Accepted Answer
More Answers (1)
Mathieu NOE
on 11 Mar 2022
0 votes
the results appears like this for n = 5
N =
16 0 0 0 0
8 8 0 0 0
4 4 4 0 0
2 2 2 2 0
1 1 1 1 1
the bottom line is the starting values (Ni,o = 1)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!