필터 지우기
필터 지우기

What is the fastest way of writing large Simulink output data to csv file

조회 수: 7 (최근 30일)
swenia
swenia 2018년 6월 12일
댓글: Jan 2018년 6월 12일
I've run 1000 simulations with very small time steps in Simulink and stored the data in Simulink.SimulationOutput. I'd like to extract some info from this output and write it to a CSV file for each case. I tried creating a table for each simulation in a for loop and used the following command to save 1000 CSV files:
filename = fullfile('Results', filesep, sprintf('out_%d.csv',j));
writetable(T, fname)
Apparently for some simulations I have uneven numbers of rows so Table didn't work for me. I don't know which cases have uneven numbers, and I ran my simulation on a cluster. So to inspect that I then I tried saving the output with the following command with an intention to carry it to my computer to find out which simulation result(s) causes the problem.
save('results', 'out', '-v7.3')
The problem is that this file is ending up to be much larger than I expected (it's still running and the last time I checked it was going over 15 GB). Even after saving this, I won't be able to open it on my PC due to the file size. And I'd like to process the data with another software, so I'd like to save each simulation as a separate CSV file. What is the fastest way to do this for a handful of variables with different sizes?
PS: I don't want to decrease my simulation sample time any further, so I have to work with what I have right now.
  댓글 수: 3
swenia
swenia 2018년 6월 12일
Jan, thank you for your comment. Per your suggestion, I tried saving each case as a separate MAT file and that was really fast! But the problem is, I still need it as a txt or a csv format because the software I need to process this data with does not read MAT files.
Jan
Jan 2018년 6월 12일
Does it accept another type of binary file formats?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by