Warning message from signals comparing
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Sara Nadeau
on 12 Mar 2018
Edited: Sara Nadeau
on 12 Mar 2018
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 Comments
See Also
Categories
Find more on Load Signal Data for Simulation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!