主要内容

ModelFinderFilter

Model Finder search filter

Since R2025a

    Description

    Use a ModelFinderFilter object to narrow down the search results of database searches for examples, models, and projects using the modelfinder function. The filter object enables you to narrow down the search results based on parameters such as MathWorks® products, model locations, block types, or referenced files. After you create a ModelFinderFilter object, use the object as an input argument to the modelfinder function.

    Creation

    To create a ModelFinderFilter object, use the modelfinder.searchFilter function.

    Properties

    expand all

    Names or types of blocks in a model, represented as a string scalar for a single block or a string array for multiple blocks.

    Example: "gain"

    Example: ["Unit Delay","Mux","Ramp"]

    Data Types: string

    Names of the MathWorks products used by the examples, models, or projects, represented as a string scalar for a single product or a string array for multiple products. For a list of MathWorks products, see Products and Services. Product names are case-insensitive and include the variations of the name you enter. For example, product="Simscape" includes the MathWorks products Simscape™, Simscape Battery™, Simscape Driveline™, and others.

    Example: "Parallel Computing"

    Data Types: string

    Relative paths to the models or projects that are indexed with an active Model Finder database, represented as a string scalar for a single location or a string array for multiple locations.

    Example: "communication/6g/"

    Data Types: string

    Names of external files that are referenced in a model or example, represented as a string scalar for a single file or a string array for multiple files.

    Example: "mdl_dd"

    Data Types: string

    Metadata of the examples and models indexed in databases where search term is matched, represented as a string scalar or string array. The metadata includes model names, example names, model paths, description, annotation, block names, block types, MathWorks products, and referenced files. By default, Model Finder matches a search term with all of the metadata information. You can set the match property to match a search term with only the names, annotations, or descriptions of models and example.

    Example: "name"

    Data Types: string

    Examples

    collapse all

    Create a ModelFinderFilter object containing specific MathWorks product names and Simulink® blocks.

    blockList = ["ConstellationDiagram",...
                 "Rectangular QAM Modulator Baseband"];
    productList = ["Communications","5G","Wireless","Satellite"];
    mfFilter = modelfinder.searchFilter(block=blockList,product=productList)
       mfFilter = 
    
      ModelFinderFilter with properties:
    
            match: [0×0 string]
          product: ["Communications"    "5G"    "Wireless"    "Satellite"]
         location: [0×0 string]
            block: ["ConstellationDiagram"    "Rectangular QAM Modulator Baseband"]
        reference: [0×0 string]

    Modify the block property of the filter object.

    mfFilter.block = ["Unit Delay","Mux","Ramp"]
    mfFilter = 
    
      ModelFinderFilter with properties:
    
            match: [0×0 string]
          product: ["Communications"    "5G"    "Wireless"    "Satellite"]
         location: [0×0 string]
            block: ["Unit Delay"    "Mux"    "Ramp"]
        reference: [0×0 string]

    Alternatives

    You can search databases and apply filters by using the Model Finder user interface. For more information, see Model Finder.

    Version History

    Introduced in R2025a