Breaking A Table into Smaller Tables Automatically Based on Specific Values
조회 수: 2 (최근 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
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 Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!