Error while extracting time table from Dataset with Enum signal

8 ビュー (過去 30 日間)
Geraldo Rebouças
Geraldo Rebouças 2022 年 6 月 15 日
回答済み: Brahmadev 2023 年 10 月 6 日
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.

回答 (1 件)

Brahmadev
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!

カテゴリ

Help Center および File ExchangeTables についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by