CLASS ndi.database.binarydoc
NDI_BINARYDOC - a binary file class that handles reading/writing
Superclasses
handle
Properties
none
Methods
Method | Description |
---|---|
addlistener | addlistener Add listener for event. |
binarydoc | a binary file class that handles reading/writing |
delete | close an ndi.database.binarydoc and delete its handle |
eq | == (EQ) Test handle equality. |
fclose | Close one or all open files |
feof | Test for end of file |
findobj | FINDOBJ Find objects matching specified conditions. |
findprop | findprop Find property of MATLAB handle object. |
fopen | Open file or obtain information about open files |
fread | Read data from binary file |
fseek | Move file position pointer to specified position in file |
ftell | Current location of file position pointer in file |
fwrite | Write data to binary file |
ge | >= (GE) Greater than or equal relation for handles. |
gt | > (GT) Greater than relation for handles. |
isvalid | ISVALID Test handle validity. |
le | <= (LE) Less than or equal relation for handles. |
listener | listener Add listener for event without binding the listener to the source object. |
lt | < (LT) Less than relation for handles. |
ne | ~= (NE) Not equal relation for handles. |
notify | NOTIFY Notify listeners of event. |
Methods help
addlistener - addlistener Add listener for event.
el = addlistener(hSource, Eventname, callbackFcn) creates a listener
for the event named Eventname. The source of the event is the handle
object hSource. If hSource is an array of source handles, the listener
responds to the named event on any handle in the array. callbackFcn
is a function handle that is invoked when the event is triggered.
el = addlistener(hSource, PropName, Eventname, Callback) adds a
listener for a property event. Eventname must be one of
'PreGet', 'PostGet', 'PreSet', or 'PostSet'. Eventname can be
a string scalar or character vector. PropName must be a single
property name specified as string scalar or character vector, or a
collection of property names specified as a cell array of character
vectors or a string array, or as an array of one or more
matlab.metadata.Property objects. The properties must belong to the
class of hSource. If hSource is scalar, PropName can include dynamic
properties.
For all forms, addlistener returns an event.listener. To remove a
listener, delete the object returned by addlistener. For example,
delete(el) calls the handle class delete method to remove the listener
and delete it from the workspace.
addlistener binds the listener's lifecycle to the object that is the
source of the event. Unless you explicitly delete the listener, it is
destroyed only when the source object is destroyed. To control the
lifecycle of the listener independently from the event source object,
use listener or the event.listener constructor to create the listener.
See also listener, event.listener, ndi.database.binarydoc, matlab.metadata.Property, events
Help for ndi.database.binarydoc/addlistener is inherited from superclass handle
binarydoc - a binary file class that handles reading/writing
Documentation for ndi.database.binarydoc/binarydoc
doc ndi.database.binarydoc
delete - close an ndi.database.binarydoc and delete its handle
DELETE(NDI_BINARYDOC_OBJ)
Closes an ndi.database.binarydoc (if necessary) and then deletes the handle.
eq - == (EQ) Test handle equality.
Handles are equal if they are handles for the same object.
H1 == H2 performs element-wise comparisons between handle arrays H1 and
H2. H1 and H2 must be of the same dimensions unless one is a scalar.
The result is a logical array of the same dimensions, where each
element is an element-wise equality result.
If one of H1 or H2 is scalar, scalar expansion is performed and the
result will match the dimensions of the array that is not scalar.
TF = EQ(H1, H2) stores the result in a logical array of the same
dimensions.
See also NDI.DATABASE.BINARYDOC, NDI.DATABASE.BINARYDOC/GE, NDI.DATABASE.BINARYDOC/GT, NDI.DATABASE.BINARYDOC/LE, NDI.DATABASE.BINARYDOC/LT, NDI.DATABASE.BINARYDOC/NE
Help for ndi.database.binarydoc/eq is inherited from superclass handle
fclose - Close one or all open files
This MATLAB function closes an open file.
Syntax
fclose(fileID)
fclose('all')
status = fclose(___)
Input Arguments
fileID - File identifier
integer
Examples
openExample('matlab/ReadFileEx28668493Example')
See also ferror, fopen, frewind, fseek, ftell, feof, fscanf, fprintf,
fread, fwrite
Introduced in MATLAB before R2006a
Documentation for fclose
doc fclose
feof - Test for end of file
This MATLAB function returns a 1 if the end of the file specified by
fileID was reached by a previous operation.
Syntax
status = feof(fileID)
Input Arguments
fileID - File identifier
integer
Examples
openExample('matlab/ReadUntilEndOfFileEx74121020Example')
See also fclose, ferror, fopen, frewind, fseek, ftell
Introduced in MATLAB before R2006a
Documentation for feof
doc feof
findobj - FINDOBJ Find objects matching specified conditions.
The FINDOBJ method of the HANDLE class follows the same syntax as the
MATLAB FINDOBJ command, except that the first argument must be an array
of handles to objects.
HM = FINDOBJ(H, <conditions>) searches the handle object array H and
returns an array of handle objects matching the specified conditions.
Only the public members of the objects of H are considered when
evaluating the conditions.
See also FINDOBJ, NDI.DATABASE.BINARYDOC
Help for ndi.database.binarydoc/findobj is inherited from superclass handle
findprop - findprop Find property of MATLAB handle object.
p = findprop(H,PropName) finds and returns the matlab.metadata.Property
object associated with property name PropName of scalar handle object H.
PropName can be a string scalar or character vector. It can be the
name of a property defined by the class of H or a dynamic property
added to scalar object H.
If no property named PropName exists for object H, an empty
matlab.metadata.Property array is returned.
See also ndi.database.binarydoc, ndi.database.binarydoc/findobj, dynamicprops, matlab.metadata.Property
Help for ndi.database.binarydoc/findprop is inherited from superclass handle
fopen - Open file or obtain information about open files
This MATLAB function opens the file, filename, for binary read access,
and returns an integer file identifier equal to or greater than 3.
Syntax
fileID = fopen(filename)
fileID = fopen(filename,permission)
fileID = fopen(filename,permission,machinefmt,encodingIn)
[fileID,errmsg] = fopen(___)
filename = fopen(fileID)
[filename,permission,machinefmt,encodingOut] = fopen(fileID)
Input Arguments
filename - Name of file to open
string scalar | character vector
permission - File access type
'r' (default) | 'w' | 'a' | 'r+' | 'w+' | 'a+' | 'A' | 'W' | ...
machinefmt - Order for reading or writing bytes or bits
'n' (default) | 'b' | 'l' | 's' | 'a' | ...
encodingIn - Character encoding
'UTF-8' | 'ISO-8859-1' | 'windows-1251' | 'windows-1252' | ...
fileID - File identifier of an open file
integer
Examples
web /Applications/MATLAB_R2024b.app/help/matlab/ref/fopen.html#btrnibo-2
web /Applications/MATLAB_R2024b.app/help/matlab/ref/fopen.html#btrnoom-1
web /Applications/MATLAB_R2024b.app/help/matlab/ref/fopen.html#btrnoon-1
web /Applications/MATLAB_R2024b.app/help/matlab/ref/fopen.html#btrnooo-1
See also fclose, openedFiles, ferror, fseek, ftell, feof, fscanf,
fprintf, fread, fwrite, frewind
Introduced in MATLAB before R2006a
Documentation for fopen
doc fopen
fread - Read data from binary file
This MATLAB function reads data from an open binary file into column
vector A and positions the file pointer at the end-of-file marker.
Syntax
A = fread(fileID)
A = fread(fileID,sizeA)
A = fread(fileID,precision)
A = fread(fileID,sizeA,precision)
A = fread(___,skip)
A = fread(___,machinefmt)
[A,count] = fread(___)
Input Arguments
fileID - File identifier
integer
sizeA - Dimensions of output array
Inf (default) | integer | two-element row vector
precision - Class and size of values to read
'uint8=>double' (default) | character vector or string scalar
skip - Number of bytes to skip
0 (default) | scalar
machinefmt - Order for reading bytes
'n' (default) | 'b' | 'l' | 's' | 'a' | ...
Output Arguments
A - File data
column vector | matrix
count - Number of characters read
scalar
Examples
openExample('matlab/ReadEntireFileofuint8DataExample')
openExample('matlab/ReadEntireFileofDoublePrecisionDataExample')
openExample('matlab/ReadSelectedRowsorColumnsfromFileExample')
openExample('matlab/ReadDigitsofBinaryCodedDecimalValuesExample')
See also fclose, fgetl, fopen, fscanf, fprintf, fwrite, fseek, ftell
Introduced in MATLAB before R2006a
Documentation for fread
doc fread
fseek - Move file position pointer to specified position in file
This MATLAB function sets the file position indicator offset bytes from
origin in the specified file.
Syntax
fseek(fileID,offset,origin)
status = fseek(___)
Input Arguments
fileID - File identifier
integer
offset - Number of bytes
integer
origin - Starting location
integer | character vector | string
Examples
openExample('matlab/SeekToNewPositionInFileEx03609470Example')
See also fclose, feof, ferror, fopen, frewind, ftell, fscanf, fprintf,
fread, fwrite
Introduced in MATLAB before R2006a
Documentation for fseek
doc fseek
ftell - Current location of file position pointer in file
This MATLAB function returns the current location of the position
pointer in the specified file.
Syntax
position = ftell(fileID)
Input Arguments
fileID - File identifier
integer
Examples
openExample('matlab/FindCurrentFilePositionEx71849017Example')
See also fclose, feof, ferror, fopen, frewind, fseek, fscanf, fprintf,
fread, fwrite
Introduced in MATLAB before R2006a
Documentation for ftell
doc ftell
fwrite - Write data to binary file
This MATLAB function writes the elements of array A as 8-bit unsigned
integers to a binary file in column order.
Syntax
fwrite(fileID,A)
fwrite(fileID,A,precision)
fwrite(fileID,A,precision,skip)
fwrite(fileID,A,precision,skip,machinefmt)
count = fwrite(___)
Input Arguments
fileID - File identifier
integer | 1 | 2
A - Data to write
numeric array | character array | string array
precision - Class and size of values to write
'uint8' (default) | character vector | string scalar
skip - Number of bytes to skip
0 (default) | scalar
machinefmt - Order for writing bytes
'n' (default) | 'b' | 'l' | 's' | 'a'
Examples
openExample('matlab/WriteUint8DataToFileExample')
openExample('matlab/Write4byteIntegersToFileExample')
openExample('matlab/AppendDataToBinaryFileExample')
openExample('matlab/WriteBinaryFileWithBigendianByteOrderingExample')
See also fclose, ferror, fopen, fprintf, fread, fscanf, fseek, ftell
Introduced in MATLAB before R2006a
Documentation for fwrite
doc fwrite
ge - >= (GE) Greater than or equal relation for handles.
H1 >= H2 performs element-wise comparisons between handle arrays H1 and
H2. H1 and H2 must be of the same dimensions unless one is a scalar.
The result is a logical array of the same dimensions, where each
element is an element-wise >= result.
If one of H1 or H2 is scalar, scalar expansion is performed and the
result will match the dimensions of the array that is not scalar.
TF = GE(H1, H2) stores the result in a logical array of the same
dimensions.
See also NDI.DATABASE.BINARYDOC, NDI.DATABASE.BINARYDOC/EQ, NDI.DATABASE.BINARYDOC/GT, NDI.DATABASE.BINARYDOC/LE, NDI.DATABASE.BINARYDOC/LT, NDI.DATABASE.BINARYDOC/NE
Help for ndi.database.binarydoc/ge is inherited from superclass handle
gt - > (GT) Greater than relation for handles.
H1 > H2 performs element-wise comparisons between handle arrays H1 and
H2. H1 and H2 must be of the same dimensions unless one is a scalar.
The result is a logical array of the same dimensions, where each
element is an element-wise > result.
If one of H1 or H2 is scalar, scalar expansion is performed and the
result will match the dimensions of the array that is not scalar.
TF = GT(H1, H2) stores the result in a logical array of the same
dimensions.
See also NDI.DATABASE.BINARYDOC, NDI.DATABASE.BINARYDOC/EQ, NDI.DATABASE.BINARYDOC/GE, NDI.DATABASE.BINARYDOC/LE, NDI.DATABASE.BINARYDOC/LT, NDI.DATABASE.BINARYDOC/NE
Help for ndi.database.binarydoc/gt is inherited from superclass handle
isvalid - ISVALID Test handle validity.
TF = ISVALID(H) performs an element-wise check for validity on the
handle elements of H. The result is a logical array of the same
dimensions as H, where each element is the element-wise validity
result.
A handle is invalid if it has been deleted or if it is an element
of a handle array and has not yet been initialized.
See also NDI.DATABASE.BINARYDOC, NDI.DATABASE.BINARYDOC/DELETE
Help for ndi.database.binarydoc/isvalid is inherited from superclass handle
le - <= (LE) Less than or equal relation for handles.
Handles are equal if they are handles for the same object. All
comparisons use a number associated with each handle object. Nothing
can be assumed about the result of a handle comparison except that the
repeated comparison of two handles in the same MATLAB session will
yield the same result. The order of handle values is purely arbitrary
and has no connection to the state of the handle objects being
compared.
H1 <= H2 performs element-wise comparisons between handle arrays H1 and
H2. H1 and H2 must be of the same dimensions unless one is a scalar.
The result is a logical array of the same dimensions, where each
element is an element-wise >= result.
If one of H1 or H2 is scalar, scalar expansion is performed and the
result will match the dimensions of the array that is not scalar.
TF = LE(H1, H2) stores the result in a logical array of the same
dimensions.
See also NDI.DATABASE.BINARYDOC, NDI.DATABASE.BINARYDOC/EQ, NDI.DATABASE.BINARYDOC/GE, NDI.DATABASE.BINARYDOC/GT, NDI.DATABASE.BINARYDOC/LT, NDI.DATABASE.BINARYDOC/NE
Help for ndi.database.binarydoc/le is inherited from superclass handle
listener - listener Add listener for event without binding the listener to the source object.
el = listener(hSource, Eventname, callbackFcn) creates a listener
for the event named Eventname. The source of the event is the handle
object hSource. If hSource is an array of source handles, the listener
responds to the named event on any handle in the array. callbackFcn
is a function handle that is invoked when the event is triggered.
el = listener(hSource, PropName, Eventname, callback) adds a
listener for a property event. Eventname must be one of
'PreGet', 'PostGet', 'PreSet', or 'PostSet'. Eventname can be a
string sclar or character vector. PropName must be either a single
property name specified as a string scalar or character vector, or
a collection of property names specified as a cell array of character
vectors or a string array, or as an array of one ore more
matlab.metadata.Property objects. The properties must belong to the
class of hSource. If hSource is scalar, PropName can include dynamic
properties.
For all forms, listener returns an event.listener. To remove a
listener, delete the object returned by listener. For example,
delete(el) calls the handle class delete method to remove the listener
and delete it from the workspace. Calling delete(el) on the listener
object deletes the listener, which means the event no longer causes
the callback function to execute.
listener does not bind the listener's lifecycle to the object that is
the source of the event. Destroying the source object does not impact
the lifecycle of the listener object. A listener created with listener
must be destroyed independently of the source object. Calling
delete(el) explicitly destroys the listener. Redefining or clearing
the variable containing the listener can delete the listener if no
other references to it exist. To tie the lifecycle of the listener to
the lifecycle of the source object, use addlistener.
See also addlistener, event.listener, ndi.database.binarydoc, matlab.metadata.Property, events
Help for ndi.database.binarydoc/listener is inherited from superclass handle
lt - < (LT) Less than relation for handles.
H1 < H2 performs element-wise comparisons between handle arrays H1 and
H2. H1 and H2 must be of the same dimensions unless one is a scalar.
The result is a logical array of the same dimensions, where each
element is an element-wise < result.
If one of H1 or H2 is scalar, scalar expansion is performed and the
result will match the dimensions of the array that is not scalar.
TF = LT(H1, H2) stores the result in a logical array of the same
dimensions.
See also NDI.DATABASE.BINARYDOC, NDI.DATABASE.BINARYDOC/EQ, NDI.DATABASE.BINARYDOC/GE, NDI.DATABASE.BINARYDOC/GT, NDI.DATABASE.BINARYDOC/LE, NDI.DATABASE.BINARYDOC/NE
Help for ndi.database.binarydoc/lt is inherited from superclass handle
ne - ~= (NE) Not equal relation for handles.
Handles are equal if they are handles for the same object and are
unequal otherwise.
H1 ~= H2 performs element-wise comparisons between handle arrays H1
and H2. H1 and H2 must be of the same dimensions unless one is a
scalar. The result is a logical array of the same dimensions, where
each element is an element-wise equality result.
If one of H1 or H2 is scalar, scalar expansion is performed and the
result will match the dimensions of the array that is not scalar.
TF = NE(H1, H2) stores the result in a logical array of the same
dimensions.
See also NDI.DATABASE.BINARYDOC, NDI.DATABASE.BINARYDOC/EQ, NDI.DATABASE.BINARYDOC/GE, NDI.DATABASE.BINARYDOC/GT, NDI.DATABASE.BINARYDOC/LE, NDI.DATABASE.BINARYDOC/LT
Help for ndi.database.binarydoc/ne is inherited from superclass handle
notify - NOTIFY Notify listeners of event.
NOTIFY(H, eventname) notifies listeners added to the event named
eventname for handle object array H that the event is taking place.
eventname can be a string scalar or character vector.
H is the array of handles to the event source objects, and 'eventname'
must be a character vector.
NOTIFY(H,eventname,ed) provides a way of encapsulating information
about an event which can then be accessed by each registered listener.
ed must belong to the EVENT.EVENTDATA class.
See also NDI.DATABASE.BINARYDOC, NDI.DATABASE.BINARYDOC/ADDLISTENER, NDI.DATABASE.BINARYDOC/LISTENER, EVENT.EVENTDATA, EVENTS
Help for ndi.database.binarydoc/notify is inherited from superclass handle