Info

此问题已关闭。 请重新打开它进行编辑或回答。

running the below code

1 次查看(过去 30 天)
Semih Isik
Semih Isik 2022-12-29
关闭: Jan 2022-12-29
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 个评论
Les Beckham
Les Beckham 2022-12-29
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:

回答(0 个)

此问题已关闭。

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by