made first impressions on lab_2

This commit is contained in:
ti_mo
2026-04-29 10:58:54 +02:00
parent e1d895a185
commit c8db0d1a10
2 changed files with 64 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
number_of_senders = 4;
number_of_timeslots = 1000;
access_probability = 0:0.01:1;
access_probability_length = length(access_probability);
sender_rands = zeros(number_of_senders);
% | slot1 | slot
% prob1 |
result = zeros(access_probability_length, number_of_timeslots);
% simulate all time slots on each probability
for probability_idx = 1 : access_probability_length
current_result = zeros(access_probability_length);
probability = access_probability(probability_idx);
for i = 1 : number_of_timeslots
% generate random sender accesses
for j = 1 : number_of_senders
sender_rands(j) = rand();
end
end
result(probability_idx, :) = current_result;
end