Control access to serial port object
ObjectVisibility property provides
a way for application developers to prevent end-user access to the
serial port objects created by their applications. When an object's
is set to
not return or delete that object.
Objects that are not visible are still valid. If you have access to the object (for example, from within the file that creates it), you can set and get its properties and pass it to any function that operates on serial port objects.
Any serial port object
Object is visible to
Object is not visible from the command line (except by
The following statement creates a serial port object with its
s = serial('COM1','ObjectVisibility','off'); instrfind ans = 
However, because the hidden object is in the workspace (
you can access it.
get(s,'ObjectVisibility') ans = off