select specific data from a dataset and exporting it to excel

조회 수: 7 (최근 30일)
divyansh
divyansh 2024년 2월 6일
답변: Peter O 2024년 2월 7일
I have a simulink data which have around 24000019 rows and I am not able to trasfer it to an excel sheet.I have done a simulation with discreate setting in powergui with a sample of 1e-6 and hence have lot of data point.if I change the sample rate it start to send error.so now I want to to select a few data points from the entire dataset and export it to an excel sheet.
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2024년 2월 6일
if your data exist in your workspace (does it ? ) it should be fairly simple to extract the correct rows and then save it to excel , or you wnated to do this within your simulink file ?

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

답변 (1개)

Peter O
Peter O 2024년 2월 7일
Excel permits a maximum of just over a million rows, so unfortunately your two million won't fit in a single column.
If your intent is to graph it or work with it then it's likely going to be helpful to use a reduced sampling rate (I'd also recommend just working in MATLAB for that). A couple options to consider:
I'm assuming you're using a To Workspace block, but most of the other data capture methods work similarly.
1. Set the sampling rate to be smaller for Simulink's result capture. Simulink will automatically down sample for you, and it will still run the sim at the rate you set in the Simulation Settings. Right click on the To Workspace block and select the properties. You'll see sampling time in the dialogue that pops up. Set that to a value like 0.0001 to get 10 kHz output instead of 1MHz from your solver. 2. Perform truncation of your data back in MATLAB. A2 = A(1:100:end) will pluck every hundredth sample, for instance. You can also use the downsample() function or other sample rate conversion tools. 3. Use a different format for export such as MAT or CSV. Excel still can't load more than the million, but either of those formats will keep your entire dataset.

커뮤니티

더 많은 답변 보기:  Power Electronics Community

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by