Filter löschen
Filter löschen

ihave an exponential distributed service time with a mean of 10^-3.I added the event based random number.how can i add exponential distribution repair times mean 0.1?

2 Ansichten (letzte 30 Tage)
ihave an exponential distributed service time with a mean of 10^-3.I added the event based random number.how can i add exponential distribution repair times mean 0.1?
  2 Kommentare
Mai Mohamed
Mai Mohamed am 23 Jun. 2023
can i input the event based with a mean of 10^-3(exponential distributed) to matlab code function block
function y = repairTimeFcn(u)
repairTime = random('exp',0.1);
y = u + repairTime;
end
and then input it to single server block

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Shivansh
Shivansh am 11 Sep. 2023
Hi Mai,
Yes, you can use the provided MATLAB code to generate repair times with an exponential distribution and a mean of 0.1. The random('exp',0.1) function in MATLAB generates random numbers from an exponential distribution with a mean of 0.1.
Here's an example of how you can use this code in a MATLAB Simulink model:
  • Create a MATLAB function block in your Simulink model.
  • Open the block's dialog and enter the following code in the "MATLAB Function" field:
function y = repairTimeFcn(u)
repairTime = random('exp', 0.1);
y = u + repairTime;
end
  • Connect the input u to the MATLAB function block and connect the output y to the single server block.
This MATLAB function block will take the input u (which represents the event-based random number) and generate a repair time based on an exponential distribution with a mean of 0.1. The repair time is then added to the input u, and the resulting value is passed to the single server block

Kategorien

Mehr zu Messages finden Sie in Help Center und File Exchange

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by