Whoops, accidentally had the answer in the test suite. Fixed now.
Any chance you can elaborate a bit? I can make a memoized fibonacci code, but that's not really what you're asking. I don't get what the function call with 2 arguments (and 2nd argument the function itself) is in the test set: seq = memfib(n-1, memfib);
Sorry for the confusion.
Paul, it uses a feature that was just introduced in R2017a. If the answer hadn't accidentally been in the test suite, I never would have figured this one out either!
I tried comparing this code with a non-memoized version, and it was 6 times slower!
Love the name of the problem.^^
Given an unsigned integer x, find the largest y by rearranging the bits in x
Distance walked 1D
Create a vector
Inscribed Pentagon? 2
Check to see if a Sudoku Puzzle is Solved
ASCII Birthday Cake
Return the 'Size' of a String of Code
Inhomogenous Depth Scale Interpolation
Television Screen Dimensions
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office