How to extract different values from the same array without duplicates?
Mostrar comentarios más antiguos
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 comentario
Rena Berman
el 6 de Mayo de 2021
(Answers Dev) Restored edit
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Import and Analysis en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!