Write a function that returns a function that counts the number of times it is invoked. Example:
>> h = counter; >> h() ans = 1 >> h() ans = 2 >> h() ans = 3
Note: your solution cannot use persistent variables.
solution which does not use any nested function ;)
1104 Solvers
First non-zero element in each column
470 Solvers
Replace multiples of 5 with NaN
282 Solvers
Determine the number of odd integers in a vector
321 Solvers
208 Solvers