Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

running the below code

3 Ansichten (letzte 30 Tage)
Semih Isik
Semih Isik am 29 Dez. 2022
Geschlossen: Jan am 29 Dez. 2022
I am getting a lot of error for the code below. Is there anyone to help me out to run this?
Thanks so much!
NumberOfTrials = 1000000;
TimeStep = 100;
lambda = 1,count = 1,LifeTime = 1;
LifeTimeStep = LifeTime/TimeStep;
for (i=0;i<LifeTime;i+=Step
Time = i;
FailedControllers = 0;
for (j=1;j<NumberOfTrials;j++) do
ReliabilityThreshold = lambda * exp(-i);
fail-count = 0;
for (k=1;k<=4;k++) do
if (random(unif,0,lambda) > ReliabilityThreshold) then
ControllerAvailability[k] = 1;
else
ControllerAvailability[k] = 0;
end
if (CheckForFailure(ControllerAvailability[])) then
FailedControllers ++;
Availability(count) = (NumberOfTrials - FailedControllers)/NumberOfTrials;
Availability-t(count) = i;
count ++;
end
end
  1 Kommentar
Les Beckham
Les Beckham am 29 Dez. 2022
This is not Matlab code nor is it valid C/C++ code. Looks like a mash-up of the two, perhaps.
I suggest you spend a couple of hours learning the basics of Matlab by taking this free online tutorial course:

Antworten (0)

Diese Frage ist geschlossen.

Tags

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by