Is it possible to automatically output many possibilities using a loop?
Show older comments
I have the number let's say 100, I found its initial factors which are 4 and 50. I would then like to use these factors to divide by the input 100. 100/50= 2, then 50/2 = 25. You can see the pattern where the denominator becomes the numerator and the answer becomes the denominater but, I would like to know a way to do this automatically without the need of manually typing it down. All the possible outputs will then be stored in a cell array and displayed e.g. [50,4,2,25...]. It doesn't have to be ordered.
Is this possible? I have been trying to do this but have not achieved much progress.
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!