Breaking A Table into Smaller Tables Automatically Based on Specific Values

2 ビュー (過去 30 日間)
Craig Stevens
Craig Stevens 2020 年 3 月 30 日
コメント済み: Tommy 2020 年 3 月 30 日
I have a table called Data which has values similar to below. The Time column is continuous while the Run column only increases each time a new set of non-zero data is collect. What I want to do is to create tables from this table with each table just being a specific run. So DataRun1 will be only occur from 3-7 seconds. After this I want to automatically export these new smaller tables to .txt files. I appreciate any help which can be provided.
  1 件のコメント
Tommy
Tommy 2020 年 3 月 30 日
If your table is in T, try this:
for i = unique(T.Run)'
writetable(T(T.Run == i,:), ['Run ' num2str(i) '.txt']);
end

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by