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
MENU Function: The MATLAB also has a built-in function known as menu which will display a figure Window with push buttons for the choices. The very first string passed to the

Reading from Files: There are many lower level functions which read from files. The function fscanf reads the formatted data into a matrix, by using conversion formats like %s

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

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

Curve Fitting: The data is fundamentally either discrete or continuous. In most of the applications, data is sampled, for illustration, The temperature recorded every ho

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

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

Function Stubs: The other common debugging method, which is used when there is a script main program which calls many functions, is to use the function stubs. A function stub

Graphics objects: The objects involve graphics primitives like lines and text, and also the axes used to orient the objects. These objects are organized hierarchically, and the

Illustration of Binary search: An illustration to search for the key of 91 in the vector is as shown below: The table below shows what will happen in each iteration of