Main Content

getPropertyValues

Get property values of model variable and model variable finder result objects

Since R2022a

    Description

    propVals = getPropertyValues(resultObject,propNames) returns the values of the properties specified in propNames for the model variable finder result object, resultObject. propNames must have the names of the properties of the finder result object or the model variable represented by the finder result object..

    example

    Examples

    collapse all

    Find the property values for the model variables in the sf_car model.

    Import the required namespaces to avoid using long, fully qualified class names.

    import slreportgen.finder.*

    Load the required model and search for the model variables in the model. For each result object, print the associated Bytes property.

    model_name = 'sf_car';
    load_system(model_name)
    
    
    finder = ModelVariableFinder(model_name);
    results = find(finder);
    for result = results
        getPropertyValues(result,"Bytes")
    end
    ans = 1x1 cell array
        {[8]}
    
    
    ans = 1x1 cell array
        {[8]}
    
    
    ans = 1x1 cell array
        {[168]}
    
    
    ans = 1x1 cell array
        {[8]}
    
    
    ans = 1x1 cell array
        {[8]}
    
    
    ans = 1x1 cell array
        {[8]}
    
    
    ans = 1x1 cell array
        {[8]}
    
    
    ans = 1x1 cell array
        {[168]}
    
    
    ans = 1x1 cell array
        {[504]}
    
    
    ans = 1x1 cell array
        {[192]}
    
    
    ans = 1x1 cell array
        {[48]}
    
    
    ans = 1x1 cell array
        {[880]}
    
    
    ans = 1x1 cell array
        {[88]}
    
    
    ans = 1x1 cell array
        {[8]}
    
    
    ans = 1x1 cell array
        {[8]}
    
    
    ans = 1x1 cell array
        {[168]}
    
    
    ans = 1x1 cell array
        {[80]}
    
    
    ans = 1x1 cell array
        {[192]}
    
    
    ans = 1x1 cell array
        {[48]}
    
    
    ans = 1x1 cell array
        {[48]}
    
    

    Input Arguments

    collapse all

    Finder result object, specified as an slreportgen.finder.ModelVariableResult object.

    List of properties values to access, specified as a string array or cell array of characters.

    Valid propNames elements are:

    If propNames contains invalid properties, the corresponding cell array value is N/A.

    Output Arguments

    collapse all

    Values of the accessed properties, returned as a cell array.

    Version History

    Introduced in R2022a