Eh. I can see what you're going for here, but I really think these heavily-restricted problems aren't very relevant for anything practical. If you're tasked with implementing a solution to a particular problem, such things as running time, memory consumption and numerical stability may well be on your mind, but not using anything from a long list of basic control structures and functions... not so much.
Solve other problems from the problem set, Basics - Fibonacci, and the answer will reveal itself to you (after a little reflection). I promise.
Could you please tell me how to use recursion without condition?
Well, that's me well and truly beaten! The problem specification didn't say that rounding wasn't permitted. I need to do more research, clearly, but I'm really not sure where to go from here. :-)
This ran on my computer but it can't be ran over here.
The test suite was testing for strict equality. A tolerance has been added, which now allows your solution to (rightly) pass.
this seems a bit silly
Just convert the result to uint32 xd
I hope you will not change the test suite to restrict this ;)
sorry, I forgot to rewrite,so changed.
just kidding. nice problem :)
this is what I want
Very nice! At first the problem felt a bit heavy handed with all those restrictions (no "if", no "round"???) but I see now what you were going for and I like it :)
recursion of anonymous is from the blog of Loren.
the first test (checking 'for' loops, etc.) is not really doing anything...
Thank you , have fixed it.
The thing about these "don't use this don't use that" problems is that there are so many ways around such restrictions.
you are right,it inspires us to create a lot of new idea that is my purpose
Say something funny
Free passes for everyone!
02 - Vector Variables 3
Check that number is whole number
Find the maximum two numbers of every column of a matrix
Put m balls into n boxes
Project Euler: Problem 14 Longest Collatz sequence(harder version)
Generate a vector like 1,2,2,3,3,3,4,4,4,4
Make an anonymous function that has variable output
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