Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 其它 > 资料存档
资料存档 资料存档
 
 
主题工具 显示模式
旧 2019-11-28, 17:20   #1
poster
高级会员
 
注册日期: 2019-11-21
帖子: 3,006
声望力: 66
poster 正向着好的方向发展
默认 您如何解决“未定义的函数或变量'mamfis'”?

我在MATLAB r2016a上进行边缘检测,但是有一个我不明白的错误。我在某个地方看到这个问题发生在r2015a中,这就是为什么我升级到r2016a的原因,但是我遇到了同样的问题:
未定义的函数或变量“ mamfis”

此外,我也收到此错误:
错误:文件:edge.m行:48列:6
输入字符在MATLAB语句或表达式中无效。

Irgb = imread('IMG_1769.png'); Igray = rgb2gray(Irgb); figure image(Igray,'CDataMapping','scaled') colormap('gray') title('Input Image in Grayscale') I = im2double(Igray); Gx = [-1 1]; Gy = Gx'; Ix = conv2(I,Gx,'same'); Iy = conv2(I,Gy,'same'); figure image(Ix,'CDataMapping','scaled') colormap('gray') title('Ix') figure image(Iy,'CDataMapping','scaled') colormap('gray') title('Iy') % edgeFIS=mamfis; edgeFIS = mamfis('Name','edgeDetection'); edgeFIS = addInput(edgeFIS,[-1 1],'Name','Ix'); edgeFIS = addInput(edgeFIS,[-1 1],'Name','Iy'); sx = 0.1; sy = 0.1; edgeFIS = addMF(edgeFIS,'Ix','gaussmf',[sx 0],'Name','zero'); edgeFIS = addMF(edgeFIS,'Iy','gaussmf',[sy 0],'Name','zero'); edgeFIS = addOutput(edgeFIS,[0 1],'Name','Iout'); wa = 0.1; wb = 1; wc = 1; ba = 0; bb = 0; bc = 0.7; edgeFIS = addMF(edgeFIS,'Iout','trimf',[wa wb wc],'Name','white'); edgeFIS = addMF(edgeFIS,'Iout','trimf',[ba bb bc],'Name','black'); figure subplot(2,2,1) plotmf(edgeFIS,'input',1) title('Ix') subplot(2,2,2) plotmf(edgeFIS,'input',2) title('Iy') subplot(2,2,[3 4]) plotmf(edgeFIS,'output',1) title('Iout') r1 = "If Ix is zero and Iy is zero then Iout is white"; r2 = "If Ix is not zero or Iy is not zero then Iout is black"; edgeFIS = addRule(edgeFIS,[r1 r2]); edgeFIS.Rules Ieval = zeros(size(I)); for ii = 1:size(I,1) Ieval(ii,:) = evalfis(edgeFIS,[(Ix(ii,:));(Iy(ii,:))]'); end figure image(I,'CDataMapping','scaled') colormap('gray') title('Original Grayscale Image') figure image(Ieval,'CDataMapping','scaled') colormap('gray') title('Edge Detection Using Fuzzy Logic')

更多&回答...
poster 当前离线   回复时引用此帖
 


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛禁用 表情符号
论坛启用 [IMG] 代码
论坛启用 HTML 代码



所有时间均为北京时间。现在的时间是 23:32


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.