If , else if statement problem
Show older comments
Hello i guys i have matlab code of traffic generation but in one case i did not understand the if statement, can anyone tell me what is going on in that part please? I mean what is ones inside parenthesis?
HEARTBEAT = 1;
if(1)
% P_INDEP = [1 0.8; ...
% 0 0.2];
% P_COORD = [0.1 0.8; ...
% 0.9 0.2];
P_INDEP = [1 1; ...
0 0];
P_COORD = [0 1; ...
1 0];
LAMBDA = [(HEARTBEAT/(SUPPT(2)-SUPPT(1))*DATAPKTINTS/NUMMACHINES); 1];
% mean arrival rate,, generated data per device in a given time interval.
PRIORITY = [0;1];
STARTSTATE=1;
% overwrite default values
ALRMDISTIME={'unif',mean(SUPPT)-100,mean(SUPPT)+100};
% alarm is uniformly issued btw 1700-1900 in time interval
elseif(1)
P_INDEP = [1 0.8 0.01; ...
0 0.2 0;
0 0 0.99];
P_COORD = [0.1 0.8 0; ...
0.9 0.2 0.05;
0 0 0.95];
LAMBDA = [(HEARTBEAT/(SUPPT(2)-SUPPT(1))*DATAPKTINTS/NUMMACHINES); 1; 0.001];
PRIORITY = [0;1;0];
STARTSTATE=3;
% overwrite default values
ALRMDISTROX={'unif',mean(SUPPX)-200,mean(SUPPX)+100};
ALRMDISTROY={'unif',mean(SUPPX)-200,mean(SUPPX)+100};
else
P_INDEP = [1 0 0.01 0.000001;
0 0 0 0;
0 0 0.99 0;
0 1 0 0.999999];
P_COORD = [0 0 0 0.000001;
1 0 0.05 0;
0 0 0.95 0;
0 1 0 0.999999];
LAMBDA = [(HEARTBEAT/(SUPPT(2)-SUPPT(1))*DATAPKTINTS/NUMMACHINES); 1; 0.01; 0];
PRIORITY = [0;1;0;0];
STARTSTATE=3;
end
Accepted Answer
More Answers (0)
Categories
Find more on Robotics System Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!