Shailrshah

L Membership function

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