File Input/Output Speeds

In terms of performance, is it faster to read input from a file, or is it faster to write to a file? I am trying to calculate some things and was wondering if it is more efficient to make changes to a file and have the program read and store the data, or more efficient to create a menu in the program and prompt the user for input, and write that data into a file along with the results of the calculation.

Answers (1)

Walter Roberson
Walter Roberson on 17 Oct 2016
reading is faster than writing for all devices I know of.
However, user convenience and understanding needs to be taken into account. Having a program that knows what to change and where is a more usable program than one that relies on the user known how to edit the file correctly.

Asked:

on 17 Oct 2016

Answered:

on 17 Oct 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!