function valid = validSequence(sequence, config)
    nFrames = size(sequence, 1) / config.nJoints;
    x = reshape(sequence(:,1), config.nJoints, nFrames); % x
    y = reshape(sequence(:,2), config.nJoints, nFrames); % y
    z = reshape(sequence(:,3), config.nJoints, nFrames); % z
    valid = true;
    for i=1:nFrames
        if sum(x(:, i)) == 0 || sum(y(:, i)) == 0 || sum(z(:, i)) == 0
            fprintf('Found an invalid sequence ...');
            valid = false;
            return;
        end
    end
end

