GetNomAttValue.m 867 B

1234567891011121314151617181920212223242526272829
  1. % GetNomAttValue.m
  2. %
  3. % This function returns the value of a nominal attribute in its correct form without
  4. % spaces.
  5. %
  6. % input:
  7. % attDatatype - the part that describes the attribute after its name
  8. %
  9. % output:
  10. % attValue - nominal attribute in its correct form
  11. function [attValue] = GetNomAttValue(attDatatype)
  12. openCurl = strfind(attDatatype, '{');
  13. closeCurl = strfind(attDatatype, '}');
  14. if (isempty(openCurl) && isempty(closeCurl))
  15. isNom = false;
  16. nominalMap = containers.Map;
  17. numericMap = containers.Map;
  18. return;
  19. end
  20. assert(length(openCurl) == 1, ['Invalid attribute datatype ' attDatatype]);
  21. assert(length(closeCurl) == 1, ['Invalid attribute datatype ' attDatatype]);
  22. attValue = attDatatype(openCurl:closeCurl);
  23. % remove spaces from nominal
  24. attValue = attValue(~isspace(attValue));
  25. end