How to extract different values from the same array without duplicates?
Show older comments
As a result of extracting using the datasample function from the state array with update information, all the same values were extracted.
I want to extract different update information.
....
for i = 1:1: user_num
% 3) delay update
state(i,3) = arrayfun(A, B); % (us),
% max_delay
max_t = max(state(i,3));
fprintf('max_t = %d\n', max_t );
% Returns 'i' observations uniformly randomly extracted from the delay index of the current cluster
i_station = datasample(state(i,3), 1); % Data of i-station in the same matrix
fprintf('i_station = %d\n', i_station);
j_station = datasample(state(i,3), 1); % Data of j-station in the same matrix
fprintf('j_station = %d\n', j_station);
% max| j_station - i_station|
at_t_delay = max(abs(j_station - i_station));
% delay 대소 비교에 따른 작업 조건
if (at_t_delay > max_t)
...
...
...
end
end
[Excuation result]
1 Comment
Rena Berman
on 6 May 2021
(Answers Dev) Restored edit
Accepted Answer
More Answers (0)
Categories
Find more on Data Import and Analysis 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!