Main Content

isConfigured

Determine if dictionary has types assigned to keys and values

    Description

    example

    tf = isConfigured(d) returns a logical 1 (true) if the specified dictionary is configured, and it returns a logical 0 (false) if it is not. A dictionary is configured when it has types assigned to keys and values. When entries are added to an unconfigured dictionary, it becomes configured.

    Examples

    collapse all

    Create a dictionary and determine if it is configured.

    d = dictionary;
    tf = isConfigured(d)
    tf = logical
       0
    
    

    Now, create a dictionary that contains one key-value pair and determine if it is configured.

    d = dictionary(1,"Blue");
    tf = isConfigured(d)
    tf = logical
       1
    
    

    Input Arguments

    collapse all

    Dictionary, specified as a dictionary object.

    Tips

    • A dictionary without entries can become configured by assigning empty arrays of the disired data type to the dictionary keys and values.

    Version History

    Introduced in R2022b