GetMetaExtraPosArff.m 721 B

1234567891011121314151617181920212223
  1. % GetMetaExtraPosArff.m
  2. %
  3. % This function finds the position of a metadata stored in the extra metadata.
  4. % The default metadata are width_px, height_px, height_mm, width_mm, distance_mm
  5. % are accessed as fields of the structure.
  6. %
  7. % input:
  8. % arffMeta - structure holding the metadata
  9. % metaName - name of the metadata to find
  10. %
  11. % output:
  12. % metaIndex - index in the metadata field extra which is an nx2 cell array
  13. function metaIndex = GetMetaExtraPosArff(arffMeta, metaName)
  14. metaIndex = 0;
  15. for i=1:size(arffMeta.extra,1)
  16. if(strcmpi(arffMeta.extra{i,1}, metaName) == 1)
  17. metaIndex = i;
  18. end
  19. end
  20. assert(metaIndex > 0, ['Extra metadata ' metaName ' not found']);
  21. end