Recommended method for importing data in bus object format into a Rapid Accelerator simulation.
2 次查看(过去 30 天)
显示 更早的评论
Would very much appreciate recommendations / guidance on the below.
I wish to do the following:
- Run model1 (a physical system), log the simulation results.
- Run model2 (a monitoring system), importing the model1 results into model2
I would like model2 to run in rapid accelerator mode as I have many different tests scenarios from model1 to run through model2. The data being imported from model1 is always of the same format, but can be of different lengths (i.e. simulation times).
The model1 data is logged as a bus object and logged using signal logging + the dataset method (to logsout).
In model2, I import the logged data using the "Data Import/Export / load from workspace / input" field of the Configuration Parameters window using a command
logsout.getElement('myData');
I then import using a root level inport - which works fine in normal and accel, but not rapid accel mode. In rapid accel mode, I receive the error "Rapid accelerator only supports array or structure format".
I have also tried changing the root level inport to a "from workspace" block, but any changes to the length of the data it is pointing at trigger a rebuild, which I would like to avoid!
Comments and suggestions most welcome.
Martin.
0 个评论
采纳的回答
Andrew Schenk
2015-6-19
A From File block supports reading a MAT file that is a struct of Timeseries as a bus array. Note that you will need to save the bus output from model1 in the v7.3 format:
myData = logsout.getElement('myData').Values;
save mydata.mat -v7.3 myData
Then in model2, replace the From Workspace with the From File block being sure to specify the appropriate bus object as the output data type.
I work at MathWorks and will pass along your feature request for Timeseries support of root level input ports in Rapid Accelerator mode.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Load Signal Data for Simulation 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!