filename2azel.m 786 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. function [azi,ele] = filename2azel(filename)
  2. %rechnet den Dateinamen in Azimut und Elevation um
  3. ele=[];
  4. azi=[];
  5. if findstr(filename,'erg.')
  6. start=length(filename)-7;
  7. else
  8. start=length(filename)-4;
  9. end
  10. for (counter=start:-1:1)
  11. letter=filename(counter);
  12. if letter=='N'
  13. negativele=1;
  14. break
  15. end
  16. if letter=='P'
  17. negativele=0;
  18. break;
  19. end
  20. ele=[letter ele ];
  21. %disp(letter);
  22. end
  23. ele=str2num(ele);
  24. if (negativele==1)
  25. ele=ele*(-1);
  26. end
  27. for (counter2=(counter-1):-1:1)
  28. letter=filename(counter2);
  29. if letter=='N'
  30. negativazi=1;
  31. break
  32. end
  33. if letter=='P'
  34. negativazi=0;
  35. break;
  36. end
  37. azi=[letter azi ];
  38. end
  39. azi=str2num(azi);
  40. if (negativazi==1)
  41. azi=azi*(-1);
  42. end