Считайте данные из MDF-файлов

Этот пример показывает вам, как считать данные о канале из MDF-файла.

Откройте MDF-файл

Прежде, чем считать данные о канале из MDF-файла, открытого доступа к файлу с mdf команда.

m = mdf("CANapeReadDemo.MF4")
m = 
  MDF with properties:

   File Details
                 Name: 'CANapeReadDemo.MF4'
                 Path: '/tmp/BR2021bd_1751886_255755/mlx_to_docbook1/tp43650a5e/vnt-ex94427230/CANapeReadDemo.MF4'
               Author: 'Otmar Schneider'
           Department: 'PMC @ Vector Informatik GmbH'
              Project: 'Demo'
              Subject: 'XCPSim'
              Comment: 'Example file created with Vector CANape'
              Version: '4.10'
             DataSize: 176545
     InitialTimestamp: 2016-04-21 14:27:17.000010630

   Creator Details
    ProgramIdentifier: 'MCD14.02'
              Creator: [1x1 struct]

   File Contents
           Attachment: [0x1 struct]
         ChannelNames: {2x1 cell}
         ChannelGroup: [1x2 struct]

   Options
           Conversion: Numeric

Задайте данные, чтобы читать

read команда используется, чтобы получить данные от MDF-файла с несколькими изменениями. Требуется два первичных аргумента. Каждый - числовой индекс группы канала, из которой можно читать. Второй имя (имена) каналов в группе канала, чтобы читать. Информация об этих элементах доступна от MDF-файла.

m.ChannelGroup(1)
ans = struct with fields:
    AcquisitionName: '10 ms'
            Comment: '10 ms'
         NumSamples: 1993
           DataSize: 153461
             Sorted: 1
            Channel: [74x1 struct]

m.ChannelNames{1}
ans = 74x1 cell
    {'Counter_B4'               }
    {'Counter_B5'               }
    {'Counter_B6'               }
    {'Counter_B7'               }
    {'PWM'                      }
    {'PWM_Level'                }
    {'PWMFiltered'              }
    {'Triangle'                 }
    {'map1_8_8_uc_measure[0][0]'}
    {'map1_8_8_uc_measure[0][1]'}
    {'map1_8_8_uc_measure[0][2]'}
    {'map1_8_8_uc_measure[0][3]'}
    {'map1_8_8_uc_measure[0][4]'}
    {'map1_8_8_uc_measure[0][5]'}
    {'map1_8_8_uc_measure[0][6]'}
    {'map1_8_8_uc_measure[0][7]'}
    {'map1_8_8_uc_measure[1][0]'}
    {'map1_8_8_uc_measure[1][1]'}
    {'map1_8_8_uc_measure[1][2]'}
    {'map1_8_8_uc_measure[1][3]'}
    {'map1_8_8_uc_measure[1][4]'}
    {'map1_8_8_uc_measure[1][5]'}
    {'map1_8_8_uc_measure[1][6]'}
    {'map1_8_8_uc_measure[1][7]'}
    {'map1_8_8_uc_measure[2][0]'}
    {'map1_8_8_uc_measure[2][1]'}
    {'map1_8_8_uc_measure[2][2]'}
    {'map1_8_8_uc_measure[2][3]'}
    {'map1_8_8_uc_measure[2][4]'}
    {'map1_8_8_uc_measure[2][5]'}
      ⋮

Считайте подмножество данных индексом

Чтобы считать только подмножество данных индексом, спектр индекса предоставлен, как введено к read команда.

data = read(m, 1, m.ChannelNames{1}, 1, 10)
data=10×74 timetable
         Time         Counter_B4    Counter_B5    Counter_B6    Counter_B7    PWM    PWM_Level    PWMFiltered    Triangle    map1_8_8_uc_measure_0__0_    map1_8_8_uc_measure_0__1_    map1_8_8_uc_measure_0__2_    map1_8_8_uc_measure_0__3_    map1_8_8_uc_measure_0__4_    map1_8_8_uc_measure_0__5_    map1_8_8_uc_measure_0__6_    map1_8_8_uc_measure_0__7_    map1_8_8_uc_measure_1__0_    map1_8_8_uc_measure_1__1_    map1_8_8_uc_measure_1__2_    map1_8_8_uc_measure_1__3_    map1_8_8_uc_measure_1__4_    map1_8_8_uc_measure_1__5_    map1_8_8_uc_measure_1__6_    map1_8_8_uc_measure_1__7_    map1_8_8_uc_measure_2__0_    map1_8_8_uc_measure_2__1_    map1_8_8_uc_measure_2__2_    map1_8_8_uc_measure_2__3_    map1_8_8_uc_measure_2__4_    map1_8_8_uc_measure_2__5_    map1_8_8_uc_measure_2__6_    map1_8_8_uc_measure_2__7_    map1_8_8_uc_measure_3__0_    map1_8_8_uc_measure_3__1_    map1_8_8_uc_measure_3__2_    map1_8_8_uc_measure_3__3_    map1_8_8_uc_measure_3__4_    map1_8_8_uc_measure_3__5_    map1_8_8_uc_measure_3__6_    map1_8_8_uc_measure_3__7_    map1_8_8_uc_measure_4__0_    map1_8_8_uc_measure_4__1_    map1_8_8_uc_measure_4__2_    map1_8_8_uc_measure_4__3_    map1_8_8_uc_measure_4__4_    map1_8_8_uc_measure_4__5_    map1_8_8_uc_measure_4__6_    map1_8_8_uc_measure_4__7_    map1_8_8_uc_measure_5__0_    map1_8_8_uc_measure_5__1_    map1_8_8_uc_measure_5__2_    map1_8_8_uc_measure_5__3_    map1_8_8_uc_measure_5__4_    map1_8_8_uc_measure_5__5_    map1_8_8_uc_measure_5__6_    map1_8_8_uc_measure_5__7_    map1_8_8_uc_measure_6__0_    map1_8_8_uc_measure_6__1_    map1_8_8_uc_measure_6__2_    map1_8_8_uc_measure_6__3_    map1_8_8_uc_measure_6__4_    map1_8_8_uc_measure_6__5_    map1_8_8_uc_measure_6__6_    map1_8_8_uc_measure_6__7_    map1_8_8_uc_measure_7__0_    map1_8_8_uc_measure_7__1_    map1_8_8_uc_measure_7__2_    map1_8_8_uc_measure_7__3_    map1_8_8_uc_measure_7__4_    map1_8_8_uc_measure_7__5_    map1_8_8_uc_measure_7__6_    map1_8_8_uc_measure_7__7_    map1_8_8_uc_measure        t     
    ______________    __________    __________    __________    __________    ___    _________    ___________    ________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    ___________________    __________

    0.00082554 sec        0             0             1             0         100        0            99            18                  175                          167                          149                          127                          108                           98                          103                          121                          168                          162                          147                          127                          110                          102                          105                          120                          158                          155                          143                          126                          110                           99                          98                           109                          149                          151                          142                          127                          109                          94                           86                           90                           144                          149                          143                          128                          109                          90                           75                           73                           141                          149                          145                          131                          112                          90                           71                           64                           138                          148                          146                          134                          116                          95                           77                           69                           134                          146                          145                          136                          122                          105                          92                           88                        175            0.00082554
    0.010826 sec          0             0             1             0         100        0            99            17                  175                          167                          150                          127                          108                           99                          104                          121                          168                          162                          147                          128                          111                          102                          105                          120                          158                          156                          144                          127                          110                           99                          98                           109                          150                          151                          142                          127                          109                          94                           86                           90                           144                          150                          143                          129                          110                          90                           75                           72                           141                          149                          145                          132                          112                          90                           71                           64                           138                          148                          146                          135                          116                          95                           77                           69                           134                          146                          146                          137                          122                          106                          92                           88                        175              0.010826
    0.020826 sec          0             0             1             0         100        0            99            16                  175                          167                          150                          128                          108                           99                          104                          121                          168                          163                          148                          128                          111                          102                          106                          120                          158                          156                          144                          127                          110                           99                          98                           108                          150                          152                          143                          127                          109                          94                           86                           90                           145                          150                          144                          129                          110                          90                           75                           72                           141                          150                          145                          132                          112                          90                           71                           64                           138                          149                          146                          135                          117                          96                           77                           70                           134                          146                          146                          137                          122                          106                          92                           88                        175              0.020826
    0.030826 sec          0             0             1             0         100        0            99            15                  176                          168                          150                          128                          109                           99                          104                          121                          169                          163                          148                          129                          112                          103                          106                          120                          159                          156                          145                          128                          111                           99                          98                           108                          150                          152                          143                          128                          110                          94                           86                           90                           145                          150                          144                          130                          110                          90                           75                           72                           142                          150                          146                          133                          113                          90                           72                           64                           139                          149                          147                          135                          117                          96                           78                           70                           135                          147                          146                          137                          123                          106                          93                           89                        176              0.030826
    0.040826 sec          0             0             1             0         100        0            99            14                  176                          168                          151                          129                          109                          100                          104                          121                          169                          163                          148                          129                          112                          103                          106                          120                          159                          157                          145                          128                          111                          100                          98                           108                          151                          152                          144                          128                          110                          94                           86                           90                           145                          151                          145                          130                          111                          90                           75                           72                           142                          150                          146                          133                          113                          90                           72                           64                           139                          150                          147                          135                          117                          96                           78                           70                           135                          147                          146                          137                          123                          106                          93                           89                        176              0.040826
    0.050826 sec          0             0             1             0         100        0            99            13                  176                          168                          151                          129                          110                          100                          104                          121                          169                          163                          149                          130                          112                          103                          106                          120                          159                          157                          146                          129                          112                          100                          98                           108                          151                          153                          144                          129                          111                          95                           86                           90                           146                          151                          145                          131                          111                          91                           76                           72                           143                          151                          147                          133                          113                          91                           72                           64                           140                          150                          147                          136                          118                          96                           78                           70                           135                          147                          147                          138                          123                          107                          93                           89                        176              0.050826
    0.060826 sec          0             0             1             0         100        0            99            12                  176                          169                          152                          130                          110                          101                          105                          121                          169                          164                          149                          130                          113                          103                          106                          120                          160                          158                          146                          129                          112                          100                          98                           108                          151                          153                          145                          129                          111                          95                           86                           89                           146                          152                          145                          131                          111                          91                           76                           72                           143                          151                          147                          134                          114                          91                           72                           64                           140                          150                          148                          136                          118                          97                           78                           71                           136                          148                          147                          138                          123                          107                          94                           90                        176              0.060826
    0.070826 sec          0             0             1             0         100        0            99            11                  176                          169                          152                          130                          111                          101                          105                          121                          169                          164                          150                          131                          113                          104                          106                          120                          160                          158                          146                          130                          112                          100                          98                           108                          152                          154                          145                          130                          111                          95                           86                           89                           147                          152                          146                          131                          112                          91                           76                           72                           143                          152                          147                          134                          114                          91                           72                           64                           140                          151                          148                          136                          118                          97                           79                           71                           136                          148                          147                          138                          124                          107                          94                           90                        176              0.070826
    0.080826 sec          0             0             1             0         100        0            99            10                  177                          169                          152                          131                          111                          101                          105                          121                          170                          164                          150                          131                          114                          104                          106                          120                          160                          158                          147                          130                          113                          101                          98                           108                          152                          154                          146                          130                          112                          95                           86                           89                           147                          153                          146                          132                          112                          91                           76                           72                           144                          152                          148                          134                          114                          91                           72                           64                           141                          151                          148                          137                          118                          97                           79                           71                           137                          148                          148                          139                          124                          108                          94                           90                        177              0.080826
    0.090826 sec          0             0             1             0         100        0            99             9                  177                          169                          153                          131                          112                          102                          105                          121                          170                          165                          151                          132                          114                          104                          106                          120                          161                          159                          147                          131                          113                          101                          99                           108                          152                          155                          146                          131                          112                          95                           86                           89                           147                          153                          147                          132                          112                          91                           76                           72                           144                          152                          148                          135                          114                          92                           72                           64                           141                          151                          149                          137                          119                          97                           79                           71                           137                          149                          148                          139                          124                          108                          94                           91                        177              0.090826

Считайте определенное значение данных индексом

Обеспечение одного числового аргумента индекса получит значения данных в том индексе.

data = read(m, 1, m.ChannelNames{1}, 5)
data=1×74 timetable
        Time        Counter_B4    Counter_B5    Counter_B6    Counter_B7    PWM    PWM_Level    PWMFiltered    Triangle    map1_8_8_uc_measure_0__0_    map1_8_8_uc_measure_0__1_    map1_8_8_uc_measure_0__2_    map1_8_8_uc_measure_0__3_    map1_8_8_uc_measure_0__4_    map1_8_8_uc_measure_0__5_    map1_8_8_uc_measure_0__6_    map1_8_8_uc_measure_0__7_    map1_8_8_uc_measure_1__0_    map1_8_8_uc_measure_1__1_    map1_8_8_uc_measure_1__2_    map1_8_8_uc_measure_1__3_    map1_8_8_uc_measure_1__4_    map1_8_8_uc_measure_1__5_    map1_8_8_uc_measure_1__6_    map1_8_8_uc_measure_1__7_    map1_8_8_uc_measure_2__0_    map1_8_8_uc_measure_2__1_    map1_8_8_uc_measure_2__2_    map1_8_8_uc_measure_2__3_    map1_8_8_uc_measure_2__4_    map1_8_8_uc_measure_2__5_    map1_8_8_uc_measure_2__6_    map1_8_8_uc_measure_2__7_    map1_8_8_uc_measure_3__0_    map1_8_8_uc_measure_3__1_    map1_8_8_uc_measure_3__2_    map1_8_8_uc_measure_3__3_    map1_8_8_uc_measure_3__4_    map1_8_8_uc_measure_3__5_    map1_8_8_uc_measure_3__6_    map1_8_8_uc_measure_3__7_    map1_8_8_uc_measure_4__0_    map1_8_8_uc_measure_4__1_    map1_8_8_uc_measure_4__2_    map1_8_8_uc_measure_4__3_    map1_8_8_uc_measure_4__4_    map1_8_8_uc_measure_4__5_    map1_8_8_uc_measure_4__6_    map1_8_8_uc_measure_4__7_    map1_8_8_uc_measure_5__0_    map1_8_8_uc_measure_5__1_    map1_8_8_uc_measure_5__2_    map1_8_8_uc_measure_5__3_    map1_8_8_uc_measure_5__4_    map1_8_8_uc_measure_5__5_    map1_8_8_uc_measure_5__6_    map1_8_8_uc_measure_5__7_    map1_8_8_uc_measure_6__0_    map1_8_8_uc_measure_6__1_    map1_8_8_uc_measure_6__2_    map1_8_8_uc_measure_6__3_    map1_8_8_uc_measure_6__4_    map1_8_8_uc_measure_6__5_    map1_8_8_uc_measure_6__6_    map1_8_8_uc_measure_6__7_    map1_8_8_uc_measure_7__0_    map1_8_8_uc_measure_7__1_    map1_8_8_uc_measure_7__2_    map1_8_8_uc_measure_7__3_    map1_8_8_uc_measure_7__4_    map1_8_8_uc_measure_7__5_    map1_8_8_uc_measure_7__6_    map1_8_8_uc_measure_7__7_    map1_8_8_uc_measure       t    
    ____________    __________    __________    __________    __________    ___    _________    ___________    ________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    ___________________    ________

    0.040826 sec        0             0             1             0         100        0            99            14                  176                          168                          151                          129                          109                          100                          104                          121                          169                          163                          148                          129                          112                          103                          106                          120                          159                          157                          145                          128                          111                          100                          98                           108                          151                          152                          144                          128                          110                          94                           86                           90                           145                          151                          145                          130                          111                          90                           75                           72                           142                          150                          146                          133                          113                          90                           72                           64                           139                          150                          147                          135                          117                          96                           78                           70                           135                          147                          146                          137                          123                          106                          93                           89                        176            0.040826

Считайте подмножество данных ко времени

Чтобы считать подмножество данных ко времени, аргументы длительности предоставляются, как введено read команда.

data = read(m, 1, m.ChannelNames{1}, seconds(0.50), seconds(0.60))
data=10×74 timetable
       Time        Counter_B4    Counter_B5    Counter_B6    Counter_B7    PWM    PWM_Level    PWMFiltered    Triangle    map1_8_8_uc_measure_0__0_    map1_8_8_uc_measure_0__1_    map1_8_8_uc_measure_0__2_    map1_8_8_uc_measure_0__3_    map1_8_8_uc_measure_0__4_    map1_8_8_uc_measure_0__5_    map1_8_8_uc_measure_0__6_    map1_8_8_uc_measure_0__7_    map1_8_8_uc_measure_1__0_    map1_8_8_uc_measure_1__1_    map1_8_8_uc_measure_1__2_    map1_8_8_uc_measure_1__3_    map1_8_8_uc_measure_1__4_    map1_8_8_uc_measure_1__5_    map1_8_8_uc_measure_1__6_    map1_8_8_uc_measure_1__7_    map1_8_8_uc_measure_2__0_    map1_8_8_uc_measure_2__1_    map1_8_8_uc_measure_2__2_    map1_8_8_uc_measure_2__3_    map1_8_8_uc_measure_2__4_    map1_8_8_uc_measure_2__5_    map1_8_8_uc_measure_2__6_    map1_8_8_uc_measure_2__7_    map1_8_8_uc_measure_3__0_    map1_8_8_uc_measure_3__1_    map1_8_8_uc_measure_3__2_    map1_8_8_uc_measure_3__3_    map1_8_8_uc_measure_3__4_    map1_8_8_uc_measure_3__5_    map1_8_8_uc_measure_3__6_    map1_8_8_uc_measure_3__7_    map1_8_8_uc_measure_4__0_    map1_8_8_uc_measure_4__1_    map1_8_8_uc_measure_4__2_    map1_8_8_uc_measure_4__3_    map1_8_8_uc_measure_4__4_    map1_8_8_uc_measure_4__5_    map1_8_8_uc_measure_4__6_    map1_8_8_uc_measure_4__7_    map1_8_8_uc_measure_5__0_    map1_8_8_uc_measure_5__1_    map1_8_8_uc_measure_5__2_    map1_8_8_uc_measure_5__3_    map1_8_8_uc_measure_5__4_    map1_8_8_uc_measure_5__5_    map1_8_8_uc_measure_5__6_    map1_8_8_uc_measure_5__7_    map1_8_8_uc_measure_6__0_    map1_8_8_uc_measure_6__1_    map1_8_8_uc_measure_6__2_    map1_8_8_uc_measure_6__3_    map1_8_8_uc_measure_6__4_    map1_8_8_uc_measure_6__5_    map1_8_8_uc_measure_6__6_    map1_8_8_uc_measure_6__7_    map1_8_8_uc_measure_7__0_    map1_8_8_uc_measure_7__1_    map1_8_8_uc_measure_7__2_    map1_8_8_uc_measure_7__3_    map1_8_8_uc_measure_7__4_    map1_8_8_uc_measure_7__5_    map1_8_8_uc_measure_7__6_    map1_8_8_uc_measure_7__7_    map1_8_8_uc_measure       t   
    ___________    __________    __________    __________    __________    ___    _________    ___________    ________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    ___________________    _______

    0.50083 sec        1             1             1             0          0         0             0           -32                  182                          178                          166                          147                          128                          115                          113                          123                          176                          175                          164                          148                          130                          116                          111                          118                          169                          171                          162                          147                          128                          111                          101                          103                          164                          168                          161                          146                          126                          104                          88                           84                           161                          167                          162                          147                          125                          100                          79                           71                           159                          167                          162                          149                          127                          102                          80                           69                           156                          165                          162                          150                          131                          109                          90                           82                           151                          161                          160                          150                          136                          119                          106                          104                       182            0.50083
    0.51083 sec        1             1             1             0          0         0             0           -33                  182                          178                          166                          148                          129                          115                          113                          123                          176                          175                          164                          148                          130                          116                          111                          118                          170                          171                          162                          147                          128                          111                          101                          103                          165                          169                          162                          147                          126                          104                          88                           84                           162                          168                          162                          148                          126                          101                          80                           71                           160                          167                          163                          149                          127                          102                          80                           70                           157                          165                          162                          150                          131                          109                          90                           83                           152                          162                          160                          150                          136                          119                          107                          104                       182            0.51083
    0.52083 sec        1             1             1             0          0         0             0           -34                  182                          178                          166                          148                          129                          116                          113                          123                          176                          175                          165                          149                          130                          116                          111                          118                          170                          171                          163                          148                          129                          111                          101                          103                          165                          169                          162                          147                          126                          105                          88                           84                           162                          168                          163                          148                          126                          101                          80                           71                           160                          167                          163                          149                          128                          102                          80                           70                           157                          165                          162                          150                          131                          109                          90                           83                           152                          162                          160                          151                          136                          120                          107                          104                       182            0.52083
    0.53083 sec        1             1             1             0          0         0             0           -35                  182                          178                          166                          148                          129                          116                          113                          123                          176                          175                          165                          149                          131                          116                          111                          118                          170                          171                          163                          148                          129                          111                          101                          103                          165                          169                          162                          148                          127                          105                          88                           84                           162                          168                          163                          148                          126                          101                          80                           71                           160                          168                          163                          149                          128                          103                          80                           70                           157                          166                          162                          150                          132                          110                          91                           83                           152                          162                          160                          151                          136                          120                          107                          104                       182            0.53083
    0.54083 sec        1             1             1             0          0         0             0           -36                  182                          178                          167                          149                          130                          116                          113                          123                          176                          175                          165                          149                          131                          117                          111                          118                          170                          171                          163                          148                          129                          111                          101                          103                          165                          169                          163                          148                          127                          105                          88                           84                           163                          169                          163                          149                          127                          101                          80                           71                           161                          168                          163                          150                          128                          103                          80                           70                           158                          166                          163                          151                          132                          110                          91                           83                           153                          162                          161                          151                          137                          120                          108                          105                       182            0.54083
    0.55083 sec        1             1             1             0          0         0             0           -37                  182                          178                          167                          149                          130                          116                          113                          123                          176                          175                          165                          150                          131                          117                          111                          118                          170                          172                          164                          148                          129                          112                          101                          103                          165                          170                          163                          148                          127                          105                          88                           84                           163                          169                          163                          149                          127                          102                          80                           71                           161                          168                          164                          150                          129                          103                          81                           70                           158                          166                          163                          151                          132                          110                          91                           84                           153                          163                          161                          152                          137                          120                          108                          105                       182            0.55083
    0.56083 sec        1             1             1             0          0         0             0           -38                  182                          179                          167                          149                          130                          117                          114                          123                          177                          175                          166                          150                          132                          117                          112                          118                          170                          172                          164                          149                          130                          112                          101                          103                          166                          170                          163                          148                          128                          105                          88                           84                           163                          169                          164                          149                          127                          102                          80                           71                           161                          169                          164                          150                          129                          103                          81                           71                           158                          167                          163                          151                          132                          110                          92                           84                           153                          163                          161                          152                          137                          121                          108                          105                       182            0.56083
    0.57083 sec        1             1             1             0          0         0             0           -39                  182                          179                          167                          150                          131                          117                          114                          123                          177                          176                          166                          150                          132                          117                          112                          118                          170                          172                          164                          149                          130                          112                          101                          102                          166                          170                          164                          149                          128                          106                          89                           84                           163                          169                          164                          149                          127                          102                          80                           71                           162                          169                          164                          151                          129                          104                          81                           71                           159                          167                          164                          152                          133                          111                          92                           84                           154                          163                          161                          152                          137                          121                          108                          106                       182            0.57083
    0.58083 sec        1             1             1             0          0         0             0           -40                  182                          179                          167                          150                          131                          117                          114                          123                          177                          176                          166                          150                          132                          118                          112                          118                          171                          172                          164                          149                          130                          112                          101                          102                          166                          170                          164                          149                          128                          106                          89                           84                           164                          170                          164                          150                          128                          102                          80                           71                           162                          169                          165                          151                          129                          104                          81                           71                           159                          167                          164                          152                          133                          111                          92                           85                           154                          164                          162                          152                          138                          121                          109                          106                       182            0.58083
    0.59083 sec        1             1             1             0          0         0             0           -41                  182                          179                          168                          150                          131                          117                          114                          123                          177                          176                          166                          151                          133                          118                          112                          118                          171                          172                          165                          150                          131                          112                          101                          102                          166                          171                          164                          149                          128                          106                          89                           84                           164                          170                          165                          150                          128                          103                          81                           71                           162                          169                          165                          151                          130                          104                          82                           71                           159                          167                          164                          152                          133                          111                          92                           85                           154                          164                          162                          153                          138                          121                          109                          106                       182            0.59083

Считайте определенное значение данных ко времени

Обеспечение одной длительности получит значения данных в или самый близкий к той метке времени.

data = read(m, 1, m.ChannelNames{1}, seconds(0.55))
data=1×74 timetable
       Time        Counter_B4    Counter_B5    Counter_B6    Counter_B7    PWM    PWM_Level    PWMFiltered    Triangle    map1_8_8_uc_measure_0__0_    map1_8_8_uc_measure_0__1_    map1_8_8_uc_measure_0__2_    map1_8_8_uc_measure_0__3_    map1_8_8_uc_measure_0__4_    map1_8_8_uc_measure_0__5_    map1_8_8_uc_measure_0__6_    map1_8_8_uc_measure_0__7_    map1_8_8_uc_measure_1__0_    map1_8_8_uc_measure_1__1_    map1_8_8_uc_measure_1__2_    map1_8_8_uc_measure_1__3_    map1_8_8_uc_measure_1__4_    map1_8_8_uc_measure_1__5_    map1_8_8_uc_measure_1__6_    map1_8_8_uc_measure_1__7_    map1_8_8_uc_measure_2__0_    map1_8_8_uc_measure_2__1_    map1_8_8_uc_measure_2__2_    map1_8_8_uc_measure_2__3_    map1_8_8_uc_measure_2__4_    map1_8_8_uc_measure_2__5_    map1_8_8_uc_measure_2__6_    map1_8_8_uc_measure_2__7_    map1_8_8_uc_measure_3__0_    map1_8_8_uc_measure_3__1_    map1_8_8_uc_measure_3__2_    map1_8_8_uc_measure_3__3_    map1_8_8_uc_measure_3__4_    map1_8_8_uc_measure_3__5_    map1_8_8_uc_measure_3__6_    map1_8_8_uc_measure_3__7_    map1_8_8_uc_measure_4__0_    map1_8_8_uc_measure_4__1_    map1_8_8_uc_measure_4__2_    map1_8_8_uc_measure_4__3_    map1_8_8_uc_measure_4__4_    map1_8_8_uc_measure_4__5_    map1_8_8_uc_measure_4__6_    map1_8_8_uc_measure_4__7_    map1_8_8_uc_measure_5__0_    map1_8_8_uc_measure_5__1_    map1_8_8_uc_measure_5__2_    map1_8_8_uc_measure_5__3_    map1_8_8_uc_measure_5__4_    map1_8_8_uc_measure_5__5_    map1_8_8_uc_measure_5__6_    map1_8_8_uc_measure_5__7_    map1_8_8_uc_measure_6__0_    map1_8_8_uc_measure_6__1_    map1_8_8_uc_measure_6__2_    map1_8_8_uc_measure_6__3_    map1_8_8_uc_measure_6__4_    map1_8_8_uc_measure_6__5_    map1_8_8_uc_measure_6__6_    map1_8_8_uc_measure_6__7_    map1_8_8_uc_measure_7__0_    map1_8_8_uc_measure_7__1_    map1_8_8_uc_measure_7__2_    map1_8_8_uc_measure_7__3_    map1_8_8_uc_measure_7__4_    map1_8_8_uc_measure_7__5_    map1_8_8_uc_measure_7__6_    map1_8_8_uc_measure_7__7_    map1_8_8_uc_measure       t   
    ___________    __________    __________    __________    __________    ___    _________    ___________    ________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    _________________________    ___________________    _______

    0.55083 sec        1             1             1             0          0         0             0           -37                  182                          178                          167                          149                          130                          116                          113                          123                          176                          175                          165                          150                          131                          117                          111                          118                          170                          172                          164                          148                          129                          112                          101                          103                          165                          170                          163                          148                          127                          105                          88                           84                           163                          169                          163                          149                          127                          102                          80                           71                           161                          168                          164                          150                          129                          103                          81                           70                           158                          166                          163                          151                          132                          110                          91                           84                           153                          163                          161                          152                          137                          120                          108                          105                       182            0.55083

Значения по умолчанию выходного формата к расписанию

Выходной формат по умолчанию read команда является расписанием. Этой опцией можно также управлять с OutputFormat аргумент.

data = read(m, 1, "Triangle", 1, 10, "OutputFormat", "timetable")
data=10×1 timetable
         Time         Triangle
    ______________    ________

    0.00082554 sec       18   
    0.010826 sec         17   
    0.020826 sec         16   
    0.030826 sec         15   
    0.040826 sec         14   
    0.050826 sec         13   
    0.060826 sec         12   
    0.070826 sec         11   
    0.080826 sec         10   
    0.090826 sec          9   

Выходные данные как Timeseries

Если timeseries желаем, как выведено, OutputFormat может быть задан к read команда. При выводе данных как timeseries, только один канал может быть считан за один раз.

data = read(m, 1, "Triangle", 1, 10, "OutputFormat", "timeseries")
  timeseries

  Common Properties:
            Name: 'Triangle'
            Time: [10x1 double]
        TimeInfo: tsdata.timemetadata
            Data: [10x1 int8]
        DataInfo: tsdata.datametadata

Выходные данные как векторы

Выведите от read команда может также быть задана как векторы. При выводе данных как вектора только один канал может быть считан за один раз.

[data, time] = read(m, 1, "Triangle", 1, 10, "OutputFormat", "vector")
data = 10x1 int8 column vector

   18
   17
   16
   15
   14
   13
   12
   11
   10
    9

time = 10×1

    0.0008
    0.0108
    0.0208
    0.0308
    0.0408
    0.0508
    0.0608
    0.0708
    0.0808
    0.0908

Считайте целую группу канала

Чтобы быстро считать данные из целой группы канала в одном вызове, никакие дополнительные аргументы не заданы к read команда.

data = read(m, 1, m.ChannelNames{1});

Закройте файл

Закройте доступ к MDF-файлу путем очищения его переменной из рабочей области.

clear m
Для просмотра документации необходимо авторизоваться на сайте