错误 - >整数只能与同一类的整数组合,或者标量加倍 [英] Error --> Integers can only be combined with integers of the same class, or scalar doubles

查看:921
本文介绍了错误 - >整数只能与同一类的整数组合,或者标量加倍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下两种矩阵:

fuzzySet

255  7  7
255  7  7
255  7  7

membershipMatrix

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

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

When I tried running this code portion:

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);

如何解决此错误?

谢谢。

推荐答案

将double放在fuzzySet周围?

put the double just around fuzzySet?

double(fuzzySet).*(abs(membershipMatrix-1) <= tolerance)

这篇关于错误 - &gt;整数只能与同一类的整数组合,或者标量加倍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆