Mapping Test Harness Inputs to an Excel .xlsx File
Ältere Kommentare anzeigen
The mathworks documentation( Importing Microsoft® Excel® Data ) shows how to map a .xlsx file to input ports in a test harness. This works fine if the input ports are doubles. However, if the input ports are boolean, the signal fails to map with the error: "Not compatible for simulation." I have tried using 0, 1 and TRUE, FALSE in the excel spreadsheet, but it still will not map. Is there a format for importing boolean data, or is this not supported?
1 Kommentar
Swarooph
am 23 Jun. 2017
From the looks of it, it seems that boolean may not be supported. In fact I tried with the linked example and nothing but double works. So I think you are better of creating a harness model ( Analysis > Harness > Create From Model) from your main model and add data conversion blocks . So the harness model will have double input port --> Data Conversion from double to boolean --> Main model boolean input port. Shown in the picture below:

Then using the harness you can map it now. Screenshot below:

Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Inputs finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!