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
Example of Median For the vector [1 4 5 9 12 33], the median is the average of the 5 & 9 in the middle: >> median([1 4 5 9 12 33]) ans =     7

Nested Structures: The nested structure is a structure in which at least one of the members is itself a structure. For illustration, a structure for the line segment may co

Statistics There are numerous statistical analyses which can be executed on data sets. In MATLAB software, the statistical functions are in the data analysis help topic known a

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.

Types of errors: There are some various kinds of errors which can occur in a program, that fall into the categories of run-time errors, syntax errors, and logical errors. T

Tracing: Sometimes, when a program has loops and/or selection statements and is not running properly, it is helpful in the debugging process to know exactly which statements h

Logical Built-In Functions: There are built-in functions in the MATLAB which are useful in conjunction with vectors or matrices of all logical true or false values; two of the

function sortrows - sorting strings: The function sortrows sorts each and every row as a block, or group, and it also will work on numbers. Here in this illustration the rows

Vectors of nested structures: The Combining vectors and nested structures are possible to have a vector of structures in which several fields are structures themselves. Here i

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