Breaking A Table into Smaller Tables Automatically Based on Specific Values

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

If your table is in T, try this:
for i = unique(T.Run)'
writetable(T(T.Run == i,:), ['Run ' num2str(i) '.txt']);
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

질문:

2020년 3월 30일

댓글:

2020년 3월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by