Warning message from signals comparing

1 visualizzazione (ultimi 30 giorni)
Sergio Rueda
Sergio Rueda il 8 Mar 2018
Modificato: Sara Nadeau il 12 Mar 2018
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

Risposte (1)

Sara Nadeau
Sara Nadeau il 12 Mar 2018
Modificato: Sara Nadeau il 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.

Categorie

Scopri di più su Load Signal Data for Simulation in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by