Info

この質問は閉じられています。 編集または回答するには再度開いてください。

running the below code

2 ビュー (過去 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