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.

コミュニティ

カテゴリ

Help Center および File ExchangeData 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