Create Timetable correspond to another timetable
이전 댓글 표시
Hi, I am trying to create a timetable that correspond to another timetable data that was generated from CAN data.
For example, I have this timetable with 3 variables and different data.
Reading1 = [0; 0; 3; 3; 2; 0];
Reading2 = [0; 0; 1; 1; 1; 0];
Reading3 = [0; 2; 1; 1; 2; 0];
T = table(Reading1,Reading2, Reading3);
Time = seconds(1:1:6);
TT = table2timetable(T,RowTimes=Time)
Then I would like to create another timetable that has string info for each data that may look like this.
Reading1 = ["Unit Off"; "Unit Off"; "Lock On"; "Lock On"; "Lock Off"; "Unit Off"];
Reading2 = ["Engine Off"; "Engine Off"; "Engine On"; "Engine On"; "Engine On"; "Engine Off"];
Reading3 = ["Hydralic On"; "Hydralic Pressed"; "Hydralic Off"; "Hydralic Off"; "Hydralic Pressed"; "Hydralic On"];
T = table(Reading1,Reading2, Reading3);
Time = seconds(1:1:6);
TT = table2timetable(T,RowTimes=Time)
I believe there is a way to make this work for each varible. Would it be easier if I create a table that contains all of the string infomation and somehow the timetable can refer to it by using for loop? Not sure how that would work.
Ps. I am trying to use the app designer so I believe that some of the code may not work the same. I may have some additional question regard to it.
댓글 수: 1
Dyuman Joshi
2024년 1월 18일
You can define strings corresponding to each column and then use indexing to obtain the desired table.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Timetables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!