daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Jul 17th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sig = dht_joy_can2sig(high, low)
  2.  
  3. % Vorbelegen des Signalsvektors
  4. sig = zeros(1,length(high));
  5.  
  6. % Kontrolle ob alle Zeitreihen selbe Länge
  7. if isequal(length(low), length(high)) ~= 1
  8.     disp('Fehler! Die Datenreiehn besitzen unterschiedliche Längen.');
  9.     return
  10. end
  11.  
  12. % Durcharbeiten der Zeitreihe
  13. for i=1:length(high);
  14.     switch high(i);
  15.         case 0                  %high(i) == 0;
  16.                 offsett = 0;
  17.         case 1                  %high(i) == 1;
  18.                 offsett = 50;
  19.         case 2                  %high(i) == 2;
  20.                 offsett = -100;
  21.         case 3                  %high(i) == 3;
  22.                 offsett = -50;
  23.     end
  24.     sig(i) = offsett + (low(i) * (50/256));
  25.    
  26.     assignin('base','offsett',offsett);
  27.     assignin('base','sig',sig);
  28. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top