It is relatively easy to get a MATLAB® script to generate data from mathematical functions. However, keeping a particular data set does require a little more work, particularly if the data changes each time a script is run, which will occur if the program uses a random-number generator. Saving data to a file is straightforward, but a little advanced preparation makes the process go more smoothly. Once a file is saved, it can be conveniently retrieved so that it can be used later or passed to another program for further processing. Similarly, it is possible to read data into a program that has been generated in an entirely different program. In any of these cases, data is saved in a data file, and quite often a data file is the most effective way to store the information.