GetIntervalsIndexArff.m 837 B

123456789101112131415161718192021222324
  1. % function GetIntervalsIndexArff:
  2. %
  3. % Uses the data loaded from an ARFF file along with an attribute name and type
  4. % of eye movement and returns the intervals (as indices) for the specific eye
  5. % movement.
  6. %
  7. % input:
  8. % data - data loaded from ARFF file with LoadArff
  9. % arffAttributes - attributes returned from LoadArff
  10. % attribute - attribute to consider for interval counting
  11. % moveId - id for eye movement to consider
  12. %
  13. % output:
  14. % intervals - nx2 array (start index, end index)
  15. function [intervals] = GetIntervalsIndexArff(data, arffAttributes, attribute, moveId)
  16. % initialize data
  17. intervals = zeros(0,2);
  18. % find position of attribute in data
  19. dataIndex = GetAttPositionArff(arffAttributes, attribute);
  20. intervals = GetIntervalsIndex(data(:,dataIndex), moveId);
  21. end