Comment from #3 so it doesn't get lost:
As a general rule I would suggest to return e.g. a vector of iterates, rather than printing them out inside a function.
When you call the function and return that vector, Julia will automatically output it, including the length of the resulting vector. This then allows you to save the results for later plotting etc.
This is a message that is very important to drill home at the earliest opportunity.
Comment from #3 so it doesn't get lost:
As a general rule I would suggest to return e.g. a vector of iterates, rather than printing them out inside a function.
When you call the function and return that vector, Julia will automatically output it, including the length of the resulting vector. This then allows you to save the results for later plotting etc.
This is a message that is very important to drill home at the earliest opportunity.