Open multiple timetables within an array into one matrix

2 ビュー (過去 30 日間)
Maksim Sorin
Maksim Sorin 2022 年 2 月 3 日
コメント済み: Maksim Sorin 2022 年 2 月 3 日
Hello all, I am working on a filtering script for some CAN data I am collecting. Currently, my code takes data from multiple BLF files and stores the timetables from the blf files in an array. The files are all sequential meaning that Part zero starts at 0 seconds ends at 300 seconds, then part 1 starts at 300 and ends at 600 and so on. My question is how can I "expand" the timetables in the array to essenitally end up with one giant matrix. I've tried using m=matrixtm{:, :}; but that only opens one cell at a time, and I need all the cells open into one big matrix.

採用された回答

David Hill
David Hill 2022 年 2 月 3 日
A simple loop should do the trick.
T=yourCell{1};
for k=2:length(yourCell)
T=[T;yourCell{k}];
end
  1 件のコメント
Maksim Sorin
Maksim Sorin 2022 年 2 月 3 日
Thank you so much! No idea why i was struggling to figure this one out so much.

サインインしてコメントする。

その他の回答 (1 件)

Turlough Hughes
Turlough Hughes 2022 年 2 月 3 日
Let's call the cell array data, then you can vertically concatentate as follows:
oneBigTable = vertcat(data{:});
If you want it as a matrix:
M = oneBigTable{:,:};
Note, M doesn't include the time data. If you want to add that in then I suggest that you use posixtime.

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by