Main Content

Simulink.io.PluggableNamespace class

Package: Simulink.io

Register Simulink.io.FileType objects from different name space

Description

Use the Simulink.io.PluggableNamespace class interface to implement a name space to register Simulink.io.FileType objects from custom name spaces.

In your class definition file, you must subclass your object from this base class. Simulink® requires direct inheritance from PluggableNamespace.

The process to contain the new class is similar to the one to create a custom file type. To contain your class, create a folder and add that folder path to the MATLAB® path. In that folder, create a +Simulink folder, and inside that folder, create a +io folder.

To examine issues with the registration of these objects, use the Simulink.io.getFileTypeDiagnostics function.

The Simulink.io.PluggableNamespace class is a handle class.

Class Attributes

Abstract
false
HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

classdef SimulinkIOPlugin < Simulink.io.PluggableNamespace creates a name space.

Properties

expand all

Name space to register, specified as a character array.

Example: Namespace = 'Simulink.io'

Attributes:

GetAccess
public

Data Types:

Examples

collapse all

Create a pluggable name space, MyNamespace.

Inherit from the Simulink.io.PluggableNamespace base class.

classdef MyNamespace < Simulink.io.PluggableNamespace

Implement the property, Namespace, as MyNamespace.

        properties (Access = public, Constant)
                 Namespace = 'MyNamespace';
        end
end

You can now create a folder on the MATLAB path, create a folder such as +MyNamespace and place your file types in that folder.

Introduced in R2021a