Main Content

Index and Search Models with Model Finder

Use the Model Finder to search and browse examples, models, and projects across various databases. Model Finder supports multiple databases, including the default MathWorks® Examples database. You can also create new databases or import any existing databases to Model Finder. Using multiple databases enables you to group similar models, making it simpler to share, search, maintain, and control access to these databases. You can use Model Finder to index models in your databases and to store textual information of models, such as model names, paths, blocks, and descriptions to make the models easily searchable using Model Finder.

You can use Model Finder to support a collaborative development of models in your teams:

  • Create or Import — Create a new database or use an existing database for your project.

  • Index — Save model-related textual data in the database to make models easily findable.

  • Search — Search the database to find relevant models.

To enable your team to access the database containing information of models, share the database path with the developers. This allows them to import the shared database to Model Finder for indexing or searching models.

Workflow to use Model Finder

Configure and Search Databases

Model Finder uses the default MathWorks Examples database consisting of MathWorks examples, models, and projects. You can also configure your databases with the Model Finder.

To use Model Finder to manage your team's collection of Simulink® models for a project related to Wireless Communication Systems:

  1. Create a project database — Create a dedicated database using Model Finder to store information of the Simulink models related to the project. To create a new database, use the modelfinder.createDatabase function.

    For example, create a database wireless_systems.db and assign alias Wireless Communication.

    modelfinder.createDatabase("/home/users/modelfinderdatabases/wireless_systems.db",...
    "Wireless Communication")

    Model Finder uses the aliases to display the databases. If you do not specify an alias, Model Finder uses the database filename as the alias.

    To view the list of databases available with Model Finder, open the Model Finder UI by using the modelfinderui function and view the list of databases in the Database pane.

  2. Index models in project database — Store textual information of the models, such as model names, example names, model paths, descriptions, annotations, block names, block types, and referenced files, in the database. To index models in a database, use the modelfinder.registerFolder function.

    To index models from the folder named 5G in wireless_systems.db, set the database as the default database and then index the models.

    modelfinder.setDefaultDatabase("/home/users/modelfinderdatabases/wireless_systems.db")
    modelfinder.registerFolder("/home/users/data/5G")
  3. Import project database — Team members can import the project database to Model Finder. This enables them to search for models or index their models in the project database. To import databases to Model Finder, use the modelfinder.importDatabase function. You must share the database path within your team to allow access and use the database as a central repository of models.

    Import wireless_systems.db and assign alias Wireless Communication.

    modelfinder.importDatabase("/home/users/modelfinderdatabases/wireless_systems.db",...
    "Wireless Communication")

    Note

    Model Finder supports only databases created in the same release version. To use databases from previous releases with the latest Model Finder, you must recreate them. This allows for optimal performance and access to the latest features of Model Finder.

  4. Set project database as search scope — By default, Model Finder uses the MathWorks Examples database as its search scope. To set other databases as search databases, use the modelfinder.setSearchDatabase function.

    Set wireless_systems.db as the search database.

    modelfinder.setSearchDatabase("/home/users/modelfinderdatabases/wireless_systems.db")

    Alternatively, you can change the search scope from the Model Finder UI. Open the Model Finder UI by using the modelfinderui function and select the databases from the list of available databases in the Databases pane.

  5. Search the database — Enter search terms in the Model Finder UI or use the modelfinder function to initiate a search. Model Finder supports keyword-based searches and natural language queries. When you enter a search query, Model Finder returns a set of examples, models, and projects that match your search terms in the databases set as search databases. For more information, see Search, Filter, and Browse Models.

    Search for models in the search databases using the search term mobile communication.

    modelfinder("mobile communication")
  6. Remove models from databases — If you do not want some models to appear in the search results of Model Finder, remove the folder that contains those models using the modelfinder.unregisterFolder function.

    Remove indexed folder 5G from the databases selected as search databases.

    modelfinder.unregisterFolder("/home/users/data/5G")
  7. Remove databases from Model Finder — If you do not want to index or search models in certain databases, you can remove those databases from Model Finder. For more information on removing databases from Model Finder, see modelfinder.deleteDatabase. Removing a database from Model Finder will not delete models or the database.

    Remove wireless_systems.db from Model Finder.

    modelfinder.deleteDatabase("/home/users/modelfinderdatabases/wireless_systems.db")

Note

To view the changes in the Model Finder UI made using Model Finder functions, close and reopen the Model Finder UI.

See Also

Functions

Tools

Related Topics