COAleft function creation for Fuzzy

2 views (last 30 days)
Elisa
Elisa on 16 Sep 2014
Commented: Elisa on 17 Sep 2014
Hi everyone, I am trying to implement a custom function to insert in the fuzzy toolbox for defuzzification. In particular, I would like to create the function that returns the left centroid (center of area). The code I wrote is this:
if true
% function y = COAleft(xmf,ymf)
%COAleft COA left function
% Compute the left centroid for defuzzification process
total_area = sum(ymf);
if total_area == 0,
error('Total area is zero in centroid defuzzification!');
end
tmp = sum(ymf.*xmf)/total_area;
MIN = min(xmf);
for xmf = MIN:tmp
total_arealeft = sum(ymf);
y = sum(ymf.*xmf)/total_arealeft;
end
The problem is in the result: when I insert the function in the fuzzy toolbox, the result is the simple centroid of all the area. Do you have any suggestion? Thank you!
  2 Comments
Image Analyst
Image Analyst on 16 Sep 2014
I don't know fuzzy but I know image processing. What is the "left" centroid? Is there also a "center centroid" and "right centroid"? How are they defined? I've only heard of centroid and weighted centroid.
Elisa
Elisa on 17 Sep 2014
I would like to make something similar to what reported here:
Janssen, J. A. E. B., et al. "Assessment of uncertainties in expert knowledge, illustrated in fuzzy rule-based models." Ecological Modelling 221.9 (2010): 1245-1251.

Sign in to comment.

Answers (0)

Categories

Find more on Fuzzy Logic Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!