Importing Excel data into Simulink for giving as input signal - Contains Enumeration values also

I want to import the data from Excel file to Simulink. Is it possible to import and save to .mat file in which the excel input contains enumeration values also?
  • Import excel data to Simulink - The signals in the excel file contains enumerated values also.
  • Is it possible to save to save enumerated signals to .mat file and give as input to the model?

9 Kommentare

Can you share your excel file?
The attached is the sample signal file I had used for my test harness. The test harness was having one input port. In test manager I used this excel and working fine. I want to get the data directly to harness and run the model( avoiding the use of Test Manager)
There is no data in the file.
I hope that you can see this on the excel file. The inputs for time 0 and 1 is written. Input_t is the bus name and M_ShutdownReq is the signal of Enum type.
Do you want to give this excel sheet as an input to Simulink Block ? If yes, then Signal Builder Accepts and Reads the values from .xlsx
But the signal builder is showing error because the data input from Excel contains enumerated values. Is there any example to do this?
The message on the status history of Signal Builder import is : File 'InputsTypeRemoved.xlsx' format does not comply with Signal Builder required format. Worksheet '1' contains non-numeric values.
Alright.. then in order for the signal builder to recognize or read the excel sheet, it expects the .xlsx file to be in the specified format (Attached the example). Try forming your values and macros as like in the attached example for the signal builder to recognize.
I hope this will solve your prob..
But my model will be expecting enum data inputs. Whether it will work?
Yes, it should Once the data has been imported, write a script to propagate the enum inputs to your model.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Hi Varunjith,
For the excel sheet to comply with Signal builder while importing, it should not contain non-numeric values. So, try not using non-numeric values in your excel sheet.
Following is the link for a blog, which also covers importing excel sheet into Signal Builder:
I would sugest you to use a 'From Workspace' block or a Root-Level 'Inport' block. Define your singal in the base workspace and pass it to one of those blocks.
This should be a good starting point with links to the possible ways to import your signal:

Kategorien

Produkte

Gefragt:

am 22 Dez. 2017

Beantwortet:

am 1 Jul. 2024

Community Treasure Hunt

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

Start Hunting!

Translated by