How can I read data from a histogram in SimEvents (simulink)?

1 visualización (últimos 30 días)
Abeshek Ram Natarajan
Abeshek Ram Natarajan el 21 de Mzo. de 2018
Respondida: Wilson A N el 4 de Mayo de 2018
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.

Respuestas (1)

Wilson A N
Wilson A N el 4 de Mayo de 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

Categorías

Más información sobre Discrete-Event Simulation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by