How to use Birnbaum-Saunders dist in SImulink

1 view (last 30 days)
EK
EK on 15 Jul 2022
Commented: EK on 18 Jul 2022
I have a data set from a process that is in a Birbaum-Saunders distribution. Using it in a set of tests in Matlab shows that it will produce the values I need for simulating that process correctly.
I am building this in Simulink, but am at a loss for how to actually use this non-normal distribution in the Simulink model. Can anyone tell me how to do this, or point me in the right direction?

Answers (1)

patrick1704
patrick1704 on 17 Jul 2022
Hi there,
if you are not required to fulfill special coding guidelines, the Matlab function block is always an option, with which you can directly include Matlab code: Include MATLAB code in models that generate embeddable C code - Simulink - MathWorks Deutschland
Otherwise, you can probably use uniformly distributed numbers (Generate uniformly distributed random numbers - Simulink - MathWorks Deutschland) and implement something like inverse transform sampling yourself (Inverse transform sampling - Wikipedia) to spread them according to the desired distribution.
  1 Comment
EK
EK on 18 Jul 2022
Well, I am already using Matlab function blocks for several other things, and was going to use one for this too. But I was hoping that there was some way of easily incorporating the distribution I have already generated, rather than recreating the distribution each time the function is called. Same with implementing an inverse transform to generate Birnbaum-Saunders distributed numbers from a normal distribution.
I am probably missing something obvious about using Simulink, as I am very green and inexperienced with it.

Sign in to comment.

Categories

Find more on Random Number Generation in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!