COAleft function creation for Fuzzy

2 次查看(过去 30 天)
Elisa
Elisa 2014-9-16
评论: Elisa 2014-9-17
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 个评论
Image Analyst
Image Analyst 2014-9-16
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 2014-9-17
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fuzzy Logic Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by