select specific data from a dataset and exporting it to excel

12 visualizaciones (últimos 30 días)
divyansh
divyansh el 6 de Feb. de 2024
Respondida: Peter O el 7 de Feb. de 2024
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 comentario
Mathieu NOE
Mathieu NOE el 6 de Feb. de 2024
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 ?

Iniciar sesión para comentar.

Respuestas (1)

Peter O
Peter O el 7 de Feb. de 2024
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.

Comunidades de usuarios

Más respuestas en  Power Electronics Control

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by