select specific data from a dataset and exporting it to excel
10 views (last 30 days)
Show older comments
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 Comment
Mathieu NOE
on 6 Feb 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 ?
Answers (1)
Peter O
on 7 Feb 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.
0 Comments
Communities
More Answers in the Power Electronics Control
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!