Member of the support class.
a = fread(fid)
a = fread(fid, n)
a = fread(fid, n, type)
a = fread(fid, n, type, s)
[a, b] = fread(fid)
[a, b] = fread(fid, n)
[a, b] = fread(fid, n, type)
[a, b] = fread(fid, n, type, s)
Reads binary data from a file.
| Name | Description | ||||||||||||||||||||||||||||
| fid | Specifies the identifier for the file you want to read. Use the fopen function to open a file and assign it an identifier. fid is an integer. | ||||||||||||||||||||||||||||
| n | Specifies the amount of data to read from the file specified by fid. LabVIEW discards all but the first two elements of n. If n is inf, LabVIEW reads the file until it reads all the data or an error occurs. n is a 32-bit signed integer or a 1D matrix of those values. | ||||||||||||||||||||||||||||
| type | Specifies the data type to read from the file specified by fid. If you specify s, you can add a positive integer of the form 'm*' before type. LabVIEW then skips s bytes after each m bytes it reads successfully. You also can add '=>' and a data type after type to specify the data type that LabVIEW returns. type is a string that accepts the following values.
|
||||||||||||||||||||||||||||
| s | Specifies the number of bytes to skip after each m bytes as you specify in type. s is a positive integer. |
| Name | Description |
| a | Returns the data that LabVIEW read from the file specified by fid. a is a vector or matrix of 64-bit, double-precision, floating-point numbers. |
| b | Returns the amount of data that LabVIEW read successfully from the file specified by fid. b is a positive integer. |
fid = fopen('test.dat', 'r');
[a, b] = fread(fid, [10, Inf], '10*int8=>int32', 5);
fclose(fid);