Advanced file input and output, MATLAB in Statistics

Advanced File Input and Output:

In that section, we saw how to read the values entered by user using the input as well as the output functions disp and fprintf, that shows information in windows on the screen. For file input and output (file I/O), we used the load and save the functions, that can read from a data file into the matrix, and write from a matrix to a data file. We also saw that there are three various operations which can be performed on files: reading from files, writing to files (implying writing to the starting of a file), and appending to a file (that is writing to the end of the file).

There are many different file types that use dissimilar filename extensions. Faraway, using load and save, we have worked with files in the ASCII format that usually use either the extension .dat or .txt. The load command works only if there are similar number of values in each line and the values are of similar type, so that the data can be stored in a matrix; the save command writes only from the matrix to a file. When the data to be written or file is to be read in a different format, then the lower level file I/O functions should be used.

The MATLAB software has functions which can read and write data from variousfile types like spreadsheets; usually Excel spreadsheets have the filename extension .xls. It has its own binary file type also that uses the extension .mat.

These are generally known as MAT-files, and can be used to store the variables which have been generated in the MATLAB.


Posted Date: 10/20/2012 6:15:36 AM | Location : United States







Related Discussions:- Advanced file input and output, Assignment Help, Ask Question on Advanced file input and output, Get Answer, Expert's Help, Advanced file input and output Discussions

Write discussion on Advanced file input and output
Your posts are moderated
Related Questions
Determine sequence weights for the sequences ACTA, ACTT, CGTT, and AGAT in problem 1 by using Thompson, Higgins, and Gibson method a) compute pairwise distances between sequences

Example of customizing plots: As the other illustration of customizing plots, the pieces of a pie chart can be "exploded" from the rest. In this situation, the two vectors are

Need of a nested loop: How would we sum each individual column, rather than getting an overall sum? Answer: The programming technique would need a nested loop in whi

fscanf function - file function: The fscanf reads matrix variable mat columnwise from the file specified by fid. The 'format' involves conversion characters much similar to th

Help function: Function is computing the two values, there are two output arguments in the function header (i.e., area & circum), that are placed in the square brackets [ ]. A

Illustration of Indexing: Though, rather than of creating the index vector manually as shown here, the process to initialize the index vector is use to a sort function. The al

Indexing: The Indexing is an alternate to sort a vector. With indexing, the vector is left in its original order. An index vector is used to point values in the original vecto

Vectorizing: In most of the cases in MATLAB, loops are not essential. As MATLAB is written specifically to work with the vectors and matrices, most operations can be completed

Steps for input output functions - Lower level file: The steps involved are as shown below:  Open the file.  Read the file, write to the file, or append to the file.

Opening and Closing a File: The Files are opened with the fopen function. By the default, fopen function opens a file for reading. If the other mode is preferred, a permission