Error while extracting time table from Dataset with Enum signal
8 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have a Simulink model that should operate at different modes (e.g. ON/OFF) according to varying load demands. So, I log these modes (and other signals) and export them to the workspace as a Simulink.SimulationData.Dataset object. When I run the code below:
SimOut = sim(MyModel);
MyDataSet = SimOut.logsout;
myTab = extractTimeTable(MyDataSet);
I get the following error:
Error using matlab.internal.tabular.extractTimetable
Unable to synchronize the specified data. To output data as a cell array, set 'OutputFormat' to 'cell-by-signal'.
Error in Simulink.SimulationData.Dataset/extractTimetable
Caused by:
Error using timetable/synchronize
All variables in input timetables must support missing values (e.g. floating point, categorical, datetime, duration, or text) when synchronizing using 'fillwithmissing'.
I don't get any errors if I remove the Enum signal or when I use the cell by signal output format, but I would prefer to have a single table instead.
0 件のコメント
回答 (1 件)
Brahmadev
2023 年 10 月 6 日
Hi Geraldo,
I understand that you would like to call the “extractTimetable” function for “Simulink.SimulationData.Dataset” datatype.
The function “extractTimetable” outputs in “timetable” format by default, this datatype takes a union of all signal data while padding missing values. Hence, it expects an input which supports missing values such as floating point, categorical, datetime, etc.
In MATLAB, enumeration data type does not support missing values. In order to solve this issue and extract the data into a single table, you can convert the Enum signal to a categorical or integer datatype before calling the "extractTimetable" function.
You can refer to the following MATLAB Answer for more information on converting Enumeration to integer datatype[AM1] :
Hope this helps!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!