Effacer les filtres
Effacer les filtres

COAleft function creation for Fuzzy

2 vues (au cours des 30 derniers jours)
Elisa
Elisa le 16 Sep 2014
Commenté : Elisa le 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 commentaires
Image Analyst
Image Analyst le 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 le 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Fuzzy Logic Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by