Main Content

mdfChannelInfo

从 MDF 文件获取通道元数据

自 R2023a 起

    说明

    示例

    infoTable = mdfChannelInfo(mdfFileName) 返回有关指定 MDF 文件中所有通道的信息表。

    infoTable = mdfChannelInfo(___,Name=Value) 允许指定的名称-值参量在特定通道和通道组上进行过滤,并确定返回的元数据量。

    示例

    全部折叠

    访问 MDF 文件中的通道信息。

    获取关于所有通道的信息。

    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>
    
    

    查看特定通道的信息。

    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>

    查看一个通道组中的通道信息。

    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>
    
    

    请求多个通道匹配项的其他元数据。仅查看第一列和其他表列。

    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     
    

    输入参数

    全部折叠

    MDF 文件名(包括必要的完整或相对路径),指定为字符串或字符向量。您可以使用 URL 来指定远程服务器上的文件。

    根据您要访问的位置,mdfFileName 可以采用以下形式之一。

    位置

    形式

    当前文件夹或 MATLAB® 路径

    要访问当前文件夹或 MATLAB 路径中的文件,请在 filename 中指定文件名(包括文件扩展名)。

    示例:"myMdfFile.mf4"

    其他文件夹

    要访问当前文件夹以外的文件夹中的文件,请在 filename 中指定完整或相对路径名称。

    示例:"C:\myFolder\myMdfFile.mf4"

    示例:"\dataDir\myMdfFile.mf4"

    远程位置

    要访问远程位置的文件,filename 必须包含指定为统一资源定位器 (URL) 形式的文件的完整路径:

    scheme://path_to_file/myMdfFile.mf4

    根据远程位置,scheme 可以是下表中的值之一。

    远程位置scheme
    Amazon S3™s3
    Windows Azure® Blob 存储wasb, wasbs
    HDFS™hdfs

    有关详细信息,请参阅处理远程数据

    示例:"s3://bucketname/path_to_file/myMdfFile.mf4"

    数据类型: string | char

    名称-值参数

    将可选的参量对组指定为 Name1=Value1,...,NameN=ValueN,其中 Name 是参量名称,Value 是对应的值。名称-值参量必须出现在其他参量后,但参量对组的顺序无关紧要。

    在 R2021a 之前,需要使用逗号分隔每个名称和值,并用引号将 Name 引起来。

    示例: GroupNumber=2

    对于一个组,通道组编号指定为数值标量;对于多个组,指定为数值向量。该函数返回仅在这些指定通道组中找到的通道。如果未指定,则返回所有通道组的元数据。

    示例: GroupNumber=[1,2]

    数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

    通道名称,指定为字符串或字符串数组,或者指定为字符向量或字符向量元胞数组。使用数组匹配多个通道名称中的任一个。通配符允许部分匹配。如果未指定,则返回所有通道的元数据。

    示例: Channel=["*Rate","*Speed"]

    数据类型: string | char | cell

    返回其他通道元数据,指定为 truefalse

    示例: AdditionalMetadata=true

    数据类型: logical

    输出参量

    全部折叠

    通道表中返回的通道信息。

    版本历史记录

    在 R2023a 中推出

    全部展开

    另请参阅

    函数