fuzarith

Perform fuzzy arithmetic

Syntax

C = fuzarith(X, A, B, operator)  

Description

Using interval arithmetic, C = fuzarith(X, A, B, operator) returns a fuzzy set C as the result of applying the function represented by the string, operator, that performs a binary operation on the sampled convex fuzzy sets A and B. The elements of A and B are derived from convex functions of the sampled universe, X:

Examples

point_n = 101;			% this determines MF's resolution
 	min_x = -20; max_x = 20;	% universe is [min_x, max_x]
 	x = linspace(min_x, max_x, point_n)';
 	A = trapmf(x, [-10 -2 1 3]);	% trapezoidal fuzzy set A
 	B = gaussmf(x, [2 5]);		% Gaussian fuzzy set B
 	C1 = fuzarith(x, A, B, 'sum');
 	subplot(2,1,1);
 	plot(x, A, 'b--', x, B, 'm:', x, C1, 'c');
 	title('fuzzy addition A+B');
 	C2 = fuzarith(x, A, B, 'sub');
 	subplot(2,1,2);
 	plot(x, A, 'b--', x, B, 'm:', x, C2, 'c');
 	title('fuzzy subtraction A-B');
 	C3 = fuzarith(x, A, B, 'prod');


© 1994-2005 The MathWorks, Inc.