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