- “saveToFile” is a built-in output function which saves the results of each stage to a file
- The file name is specified by the name value pair of ‘SaveFileName’
- The object that is saved in this case is a “BayesianOptimization” instance.
- Types of built-in functions: https://www.mathworks.com/help/stats/bayesian-optimization-output-functions.html#bvaz800-1:~:text=of%20the%20optimization.-,Built%2DIn,-Output%20Functions
- Syntax and Usage: https://www.mathworks.com/help/stats/bayesopt.html#d126e159918:~:text=Data%20Types%3A%20double-,OutputFcn,-%E2%80%94%20Function%20called