Warning message from signals comparing
1 次查看(过去 30 天)
显示 更早的评论
Hi folks, I built a suspension system model in simulink to diagnose faults, then I put some failures in the model, to observe its performance. I compared the two signals (100% functional model, model with fauilures)in the simulation data inspector, and now i want to make a code that generates a warning alert when the difference between this signals exceeds 10%, I tried exporting the data from Simulation Data Inspector, but I didn't know who to compare. I want to know if there is a function that compares data from structs or directly from simulink.
Sorry for my english. Thanks
0 个评论
回答(1 个)
Sara Nadeau
2018-3-12
编辑:Sara Nadeau
2018-3-12
Based on my understanding of what you want to do, I think that the Simulation Data Inspector programmatic interface should help. Have you looked into using Simulink.sdi.compareRuns?
You can use the RelTol parameter of the Simulink.sdi.Signal objects for the relevant signals to set your 10% (0.1) tolerance.
Use the Simulink.sdi.DiffRunResult object returned by Simulink.sdi.compareRuns to access the relevant Simulink.sdi.DiffSignalResult objects. The Match parameter of the Simulink.sdi.DiffSignalResult object indicates whether the difference resulting from the comparison fell within the specified tolerance.
The example Analyze Simulation Data with Signal Tolerances on the Simulink.sdi.compareRuns page should help fill in the details.
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!