Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. function s = roehre(s, gain, k1)
  2. N = size(s);
  3.  
  4. k1 = 0;
  5.  
  6. for n=1:N(1)
  7. for m=1:N(2)
  8.  
  9. if (gain == 0)
  10. gain = 000000000000001;
  11. end;
  12.  
  13. if (k1 == 0)
  14. k1 = 0.000000000000001;
  15. end;
  16.  
  17.  
  18. if (s(n,m) ~= k1)
  19.  
  20. s(n,m) = ((s(n,m)-k1)/(1-2.7182818284^(-gain*s(n,m)-k1))) + (k1/(1-2.7182818284^(gain*k1)));
  21. else
  22.  
  23. s(n,m) = (1/gain) + (k1/(1-2.7182818284^(gain*k1)));
  24. end
  25.  
  26.  
  27.  
  28. %2.7182818284
  29.  
  30.  
  31. end;
  32. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement