Problem 42936. Project Euler: Problem 11, Largest product in a grid
Solution Stats
Problem Comments
-
9 Comments
The md5.update() seems to be broken. I ran the following code in the scratch pad.
------------------------------------------
md5.update(typecast(uint64(PE11(magic(10),4)),'uint8'))
assert(isequal(sprintf('%02X',typecast(md5.digest,'uint8')),...
'9260342934CE67F6A3E74F7EF9001460'))
------------------------------------------------
Then the output is as follows:
Unable to resolve the name 'md5.update'.
@Dong-hyun: there was a problem with the test suite hiding code from the solve page. There was setup code that was being suppressed from view, but was being run before each of the tests. Accordingly, the problem was still solvable, but could not be tested via the Scratch Pad.
I have copied the necessary setup code into each test case, so it should work for you now.
Note that the "rng default" line is needed for the first test case (as is included there) but not for the other two test cases (and is, therefore, not included there).
And, to clarify my comment regarding the Scratch Pad, the test cases need to be present in the Scratch Pad in the same order, due to the reliance upon seeding the random-number generation. I would recommend copying in all three in order before testing your solution.
Solution Comments
Show commentsGroup

Project Euler II
- 12 Problems
- 51 Finishers
- Find the longest sequence of 1's in a binary sequence.
- Convert given decimal number to binary number.
- Find out sum and carry of Binary adder
- Binary numbers
- Given an unsigned integer x, find the largest y by rearranging the bits in x
- Bit Reversal
- Relative ratio of "1" in binary number
- Binary code (array)
- Converting binary to decimals
- There are 10 types of people in the world
Problem Recent Solvers99
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!