calling one program to another
Show older comments
I have a program that has a function and takes an input 'n' and runs it through the hailstone sequence and counts the number of outputs it goes through until if ends at 1. I need to write another function that takes as input n and whose output is the number less than n that has the longest Collatz sequence and the length of that maximal sequence.
the thing is, the second program MUST be a function and it MUST call the first function without just copy-pasting the first function, i have no idea how to do this...
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!