Main Content

mdfChannelInfo

Get channel metadata from MDF file

Since R2023a

    Description

    infoTable = mdfChannelInfo(mdfFileName) returns a table of information about all channels in the specified MDF file.

    infoTable = mdfChannelInfo(___,Name=Value) allows specified name-value arguments to filter on specific channels and channel groups, and determine the amount of metadata returned.

    example

    Examples

    collapse all

    Access the channel information in an MDF file.

    Get information on all channels.

    ci = mdfChannelInfo("VehicleData.mf4")
    ci =
      12×13 table
    
              Name           GroupNumber    GroupNumSamples    GroupAcquisitionName                                   GroupComment                                    GroupSourceName    GroupSourcePath    DisplayName       Unit          Comment     ExtendedNamePrefix    SourceName     SourcePath 
        _________________    ___________    _______________    ____________________    ___________________________________________________________________________    _______________    _______________    ___________    ___________    ___________   __________________    ___________    ___________
    
        "AirFlow"                 2              92033             <undefined>         Simulation of engine gas dynamics.                                               <undefined>        <undefined>          ""         g/s            <undefined>      <undefined>        <undefined>    <undefined>
        "Brake"                   1                751             <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         ft*lbf         <undefined>      <undefined>        <undefined>    <undefined>
        "EngineRPM"               1                751             <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         rpm            <undefined>      <undefined>        <undefined>    <undefined>
        "FuelRate"                2              92033             <undefined>         Simulation of engine gas dynamics.                                               <undefined>        <undefined>          ""         g/s            <undefined>      <undefined>        <undefined>    <undefined>
        "Gear"                    1                751             <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         <undefined>    <undefined>      <undefined>        <undefined>    <undefined>
        "ImpellerTorque"          1                751             <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         ft*lbf         <undefined>      <undefined>        <undefined>    <undefined>
        "OutputTorque"            1                751             <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         ft*lbf         <undefined>      <undefined>        <undefined>    <undefined>
        "Throttle"                1                751             <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         %              <undefined>      <undefined>        <undefined>    <undefined>
        "TransmissionRPM"         1                751             <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         rpm            <undefined>      <undefined>        <undefined>    <undefined>
        "VehicleSpeed"            1                751             <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         mph            <undefined>      <undefined>        <undefined>    <undefined>
        "time"                    1                751             <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         s              <undefined>      <undefined>        <undefined>    <undefined>
        "time"                    2              92033             <undefined>         Simulation of engine gas dynamics.                                               <undefined>        <undefined>          ""         s              <undefined>      <undefined>        <undefined>    <undefined>
    
    

    View information for specific channels.

    ci = mdfChannelInfo("VehicleData.mf4",Channel="*Torque")
    ci =
      2×13 table
    
              Name          GroupNumber    GroupNumSamples    GroupAcquisitionName                                   GroupComment                                    GroupSourceName    GroupSourcePath    DisplayName     Unit       Comment      ExtendedNamePrefix    SourceName     SourcePath 
        ________________    ___________    _______________    ____________________    ___________________________________________________________________________    _______________    _______________    ___________    ______    ___________    __________________    ___________    ___________
    
        "ImpellerTorque"         1               751              <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         ft*lbf    <undefined>       <undefined>        <undefined>    <undefined>
        "OutputTorque"           1               751              <undefined>         Simulation of an automatic transmission controller during passing maneuver.      <undefined>        <undefined>          ""         ft*lbf    <undefined>       <undefined>        <undefined>    <undefined>

    View channel information in one channel group.

    ci = mdfChannelInfo("VehicleData.mf4",GroupNumber=2)
    ci =
      3×13 table
    
           Name       GroupNumber    GroupNumSamples    GroupAcquisitionName               GroupComment               GroupSourceName    GroupSourcePath    DisplayName    Unit      Comment      ExtendedNamePrefix    SourceName     SourcePath 
        __________    ___________    _______________    ____________________    __________________________________    _______________    _______________    ___________    ____    ___________    __________________    ___________    ___________
    
        "AirFlow"          2              92033             <undefined>         Simulation of engine gas dynamics.      <undefined>        <undefined>          ""         g/s     <undefined>       <undefined>        <undefined>    <undefined>
        "FuelRate"         2              92033             <undefined>         Simulation of engine gas dynamics.      <undefined>        <undefined>          ""         g/s     <undefined>       <undefined>        <undefined>    <undefined>
        "time"             2              92033             <undefined>         Simulation of engine gas dynamics.      <undefined>        <undefined>          ""         s       <undefined>       <undefined>        <undefined>    <undefined>
    
    

    Request additional metadata on multiple channel matches. View only the first and additional table columns.

    ci = mdfChannelInfo("VehicleData.mf4",Channel=["*Torque","*Rate"],AdditionalMetadata=true);
    ci(:,[1,14:25])
    ans =
      3×13 table
    
              Name             Type        SyncType        DataType        NumBits    ComponentType    CompositionType    ConversionType    SourceComment    SourceType     SourceBusType    SourceBusChannelNumber    SourceSimulated
        ________________    ___________    ________    ________________    _______    _____________    _______________    ______________    _____________    ___________    _____________    ______________________    _______________
    
        "FuelRate"          FixedLength      None      RealLittleEndian      64           None              None           Unspecified           ""          Unspecified     Unspecified               0                    false     
        "ImpellerTorque"    FixedLength      None      RealLittleEndian      64           None              None           Unspecified           ""          Unspecified     Unspecified               0                    false     
        "OutputTorque"      FixedLength      None      RealLittleEndian      64           None              None           Unspecified           ""          Unspecified     Unspecified               0                    false     
    

    Input Arguments

    collapse all

    MDF file name, specified as a string or character vector, including the necessary full or relative path. You can use a URL to specify a file on a remote server.

    Depending on the location you are accessing, mdfFileName can take one of these forms.

    Location

    Form

    Current folder or MATLAB® path

    To access a file in the current folder or MATLAB path, specify the name of the file in filename, including the file extension.

    Example: "myMdfFile.mf4"

    Other folders

    To access a file in a folder other than the current folder, specify the full or relative path name in filename.

    Example: "C:\myFolder\myMdfFile.mf4"

    Example: "\dataDir\myMdfFile.mf4"

    Remote locations

    To access a file in a remote location, filename must contain the full path of the file specified as a uniform resource locator (URL) of the form:

    scheme://path_to_file/myMdfFile.mf4

    Based on the remote location, scheme can be one of the values in this table.

    Remote Locationscheme
    Amazon S3™s3
    Windows Azure® Blob Storagewasb, wasbs
    HDFS™hdfs

    For more information, see Work with Remote Data.

    Example: "s3://bucketname/path_to_file/myMdfFile.mf4"

    Data Types: string | char

    Name-Value Arguments

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

    Example: GroupNumber=2

    Channel group number, specified as a numeric scalar for one group, or numeric vector for multiple groups. The function returns channels found only in these specified channel groups. If unspecified, metadata for all channel groups are returned.

    Example: GroupNumber=[1,2]

    Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    Channel names, specified as a string or array of strings, or as a character vector or cell array of character vectors. Use an array to match on any of multiple channel names. Wildcards allow partial matching. If unspecified, metadata for all channels are returned.

    Example: Channel=["*Rate","*Speed"]

    Data Types: string | char | cell

    Return additional channel metadata, specified as true or false.

    Example: AdditionalMetadata=true

    Data Types: logical

    Output Arguments

    collapse all

    Channel information returned in a table of channels.

    Version History

    Introduced in R2023a

    expand all