Fscanf function - file function, MATLAB in Statistics

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 those used in the fprintf function. The dimensions identify the preferred dimensions of mat; if the number of values in the file is not known,  inf is used for the second dimension. For illustration, the below would read in the similar file identified earlier, that has on each line a number, then a space, then a character.

>> fid = fopen('subjexp.dat');

>> mat = fscanf(fid,'%f %c',[2 inf])

mat =

      5.3000 2.2000 3.3000 4.4000 1.1000

     97.0000 98.0000 97.0000 97.0000 98.0000

>> fclose(fid);

 

 

Posted Date: 10/20/2012 6:24:47 AM | Location : United States







Related Discussions:- Fscanf function - file function, Assignment Help, Ask Question on Fscanf function - file function, Get Answer, Expert's Help, Fscanf function - file function Discussions

Write discussion on Fscanf function - file function
Your posts are moderated
Related Questions
Function polyval - interpolation: The function polyval can then be used to compute the polynomial at particular values. For illustration, we could compute at every value in th

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

Run-time or execution-time error: The Run-time, or execution-time, errors are found whenever a script or function is executing. With most of the languages, an illustration of

Sorting Strings: For the matrix of strings, the sort function works exactly as formerly for numbers. For illustration, >> words = char('Hi', 'Hello', 'Howdy', 'Goodbye', '

Polynomials: Simple curves are polynomials of various degrees, or orders. The degree is the integer of the highest exponent in the expression. The illustrations are as follows

Editor/Debugger: The MATLAB has numerous useful functions for debugging, and debugging can also be completed through its editor, which is known as the Editor/Debugger. Typi

Debugging Techniques: Any error in the computer program is called a bug. This word is thought to date back to the 1940s, whenever a problem with an early computer was found to

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

Example of Core objects: The one core graphics object is a line that is also what the plot function produces. Here is an illustration of generating a line object, altering som

Roots function - Polynomials: The roots function in MATLAB is used to find the roots of an equation represented by a polynomial. For illustration, for the mathematical functio