I am not able to figure out why the solutions of my code to test 8 and 9 are wrong.
My wrong results:
- test 8 -> '1250000041666667776'
- test 9 -> '13107200170666672128'
I get precisely the same results as Angelo...
Angelo and Heiko, your solutions are working to a degree. However to obtain exact results on big numbers you have to use different tools. You can search for uint64 and bigdecimal. Hope it helps.
Thanks for the tip with uint64.
First line is adopted from James's solution: https://www.mathworks.com/matlabcentral/cody/problems/2455-diagonal-of-a-spiral-matrix/solutions/1239477
I was just happy I could use "diag" and "spiral" in this problem, but it's always nice to see some of my solutions get used in other code.
Remove the small words from a list of words.
Omit columns averages from a matrix
Convert a numerical matrix into a cell array of strings
Write c^3 as sum of two squares a^2+b^2
Create initial basic feasible solution for transportation problems -Minimum Cost Method
Go back n times
Check if the input is an interprime
Happy Free Wednesday!
Find the treasures in MATLAB Central and discover how the community can help you!
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