Commit 15ea9245 authored by Larkin Heintzman's avatar Larkin Heintzman

Upload New File

parent 7b7b2b62
Pipeline #22 canceled with stages
function [agentIdx, trajIdx] = covertIdxForm(absIdx, Tj)
agentIdx = zeros(size(absIdx));
trajIdx = zeros(size(absIdx));
for i=1:length(absIdx)
absIdxTemp = absIdx(i);
count = 1;
if absIdxTemp > Tj
while absIdxTemp > Tj
absIdxTemp = absIdxTemp - Tj;
count = count + 1;
end
end
trajIdx(i) = absIdxTemp;
agentIdx(i) = count;
end
% agentIdx = floor((absIdx)./(Tj)); % how many traj size steps are we?
% trajIdx = absIdx - (agentIdx-1).*Tj;
% % agentIdx = agentIdx + 1; % must account for indexing by zero
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment