How to extract different values from the same array without duplicates?
显示 更早的评论
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]
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!