Control access to serial port object
The 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 ObjectVisibility property is set to off, instrfind does 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.
Object is visible to instrfind.
Object is not visible from the command line (except by instrfindall).
The following statement creates a serial port object with its ObjectVisibility property set to off:
s = serial('COM1','ObjectVisibility','off'); instrfind ans = 
However, because the hidden object is in the workspace (s), you can access it.
get(s,'ObjectVisibility') ans = off