How can I read data from a histogram in SimEvents (simulink)?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
All the available data is in the form of histograms. Therefore, there is a necessity to read the histogram data and incorporate it into the simulation in the SimEvents package in Simulink. I would like to know if this is possible in SimEvents.
0 commentaires
Réponses (1)
Wilson A N
le 4 Mai 2018
If you have the histogram object, then you can easily retrieve the required data. For example,
hHist = histfit( rand(100,1), 3, 'normal' )
hHist(1).YData
Here hHist is the histogram object. You can obtain the y values by using hHist(1).YData.
Now the following code can be kept in a MATLAB function block. Let the output of the MATLAB function block be the hHist(1).YData which is fed into a Simulink function block. Once the data reaches a Simulink function block, you can retrieve the data from any of the callbacks present in the various SimEvents blocks.
To understand how to use Simulink function blocks with SimEvents blocks, you can check the following example:
seExampleSchedulerBasic
0 commentaires
Voir également
Catégories
En savoir plus sur Discrete-Event Simulation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!