Shailrshah

Pi Membership Function

Feb 5th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.31 KB | None | 0 0
  1. alpha=20;
  2. betaa = 30;
  3. gammaa = 40;
  4. delta = 45;
  5. for i=1:10
  6.   x(i) = i*5
  7.   if x(i)<=alpha
  8.     y(i)=0;
  9.   elseif x(i)<=betaa
  10.     y(i) = (x(i)-alpha)/(betaa-alpha)
  11.   elseif x(i) <=gammaa
  12.       y(i) = 1;
  13.    elseif x(i) <= delta
  14.      y(i)=(delta-x(i))/(delta-gammaa);
  15.   else
  16.     y(i) = 0;
  17.   end
  18. end
  19. plot(x,y)
Add Comment
Please, Sign In to add comment