<< fprintf | Stream manager | frewind >> |
res = fread(fid) |
res = fread(fid, sz, precision) |
res = fread(fid, sz, precision, skip) |
res = fread(fid, sz, precision, arch) |
res = fread(fid, sz, precision, skip, arch) |
[res, count] = fread(fid, sz, precision, skip, arch) |
a file descriptor
Dimensions of output array: scalar, [m,n] or [m, Inf]
class of values to read
number of bytes to skip
a string specifying the data format for the file.
a vector of floating point or integer type numbers
number of characters reads into res
Read data in binary form to the file specified by the file descriptor fid.
supported architecture:
native , n: format of the current machine.
ieee-be, b: IEEE big endian.
ieee-le, l: IEEE little endian.
characters encoding uses fopen parameter.
A = rand(3,1)
fileID = fopen([tempdir(), 'doubledata.bin'],'w');
fwrite(fileID, A,'double');
fclose(fileID);
fileID = fopen([tempdir(), 'doubledata.bin'],'r');
R = fread(fileID, 'double')
fclose(fileID);
fileID = fopen([tempdir(), 'uint16nine.bin'],'w');
fwrite(fileID,[1:9],'uint16');
fclose(fileID);
fileID = fopen([tempdir(), 'uint16nine.bin'],'r');
A = fread(fileID,[4,Inf],'uint16')
fclose(fileID);
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET