probor.m

Package [view]: fuzzy.rar
Upload User: hnchenxi
Upload Date: 2008-11-02
Package Size: 1083k
Code Size: 1k
Category: AI-NN-PR
Development Platform: Matlab
  1. function y=probor(x)
  2. %PROBOR Probabilistic OR.
  3. % Y = PROBOR(X) returns the probabilistic OR (also known
  4. % as the algebraic sum) of the columns of X. If X has two
  5. % rows such that X = [A; B], then Y = A + B - AB. If X has
  6. % only one row, then Y = X.
  7. %
  8. % For example:
  9. %
  10. % x = (0:0.1:10);
  11. %               figure('Name','Probabilistic OR','NumberTitle','off');
  12. %               y1 = gaussmf(x, [0.5 4]);
  13. %               y2 = gaussmf(x, [2 7]);
  14. % yy = probor([y1; y2]);
  15. % plot(x,[y1; y2; yy])
  16. % Ned Gulley, 9-19-94
  17. % Copyright 1994-2002 The MathWorks, Inc. 
  18. % $Revision: 1.14 $  $Date: 2002/04/02 21:24:59 $
  19. if size(x,1)<=1,
  20.     y=x;
  21.     return
  22. end
  23. y=x;
  24. for count=2:size(x,1),
  25.     y(count,:)=y(count-1,:)+y(count,:)-prod(y(([-1 0]+count),:));
  26. end
  27. y=y(size(y,1),:);