0

我有以下两个矩阵:

模糊集

255  7  7
255  7  7
255  7  7

会员矩阵

2.881749158360024e-04   0.999999819474077   0.904200609951489
0.0336048930092375      0.517034652401936   0.847219463816453
2.881749158360024e-04   0.999999819474077   0.904200609951489

当我尝试运行此代码部分时:

tolerance = 0.01; 
core = double(fuzzySet.*(abs(membershipMatrix-1) <= tolerance)) + membershipMatrix.*(membershipMatrix.*(abs(membershipMatrix-1) > tolerance););

我收到以下错误:

??? Error using ==> times
Integers can only be combined with integers of the same class, or scalar doubles.

Error in ==> fs at 36
core = fuzzySet.*(abs(membershipMatrix-1) <= tolerance) +
membershipMatrix.*(membershipMatrix > tolerance);

我该如何解决这个错误?

谢谢。

4

1 回答 1

8

把double放在fuzzySet周围?

double(fuzzySet).*(abs(membershipMatrix-1) <= tolerance)
于 2013-03-23T20:26:05.163 回答