【发布时间】:2012-07-02 23:21:03
【问题描述】:
我正在尝试加载图像,但它显示错误消息Undefined function or method 'readimage' for input arguments of type 'char'.
我的调用函数在这里
h=uicontrol(FigWin,...
'Style','pushbutton',...
'Position',[0,320,80,20],...
'String','Load',...
'Callback',...
['image1=loadimage;'...
'subplot(AxesHandle1);'...
'imagesc(image1);'...
'title(textLoad);'...
'colormap(gray);']);
我调用的函数在下面
function image1=loadimage
[imagefile1 , pathname]= uigetfile('*.bmp;*.BMP;*.tif;*.TIF;*.jpg','Open An Fingerprint image');
if imagefile1 ~= 0
cd(pathname);
image1=readimage(char(imagefile1));
image1=255-double(image1);
end
end
另一个问题,如果程序中有警告,是不是有问题?对不起,我是 Matlab 的新手。谢谢你。
【问题讨论】:
-
MATLAB 中没有名为 readimage 的函数。你定义了自己的吗?或者您可以尝试改用imread。
-
谢谢。我的 readimage 函数就像
function b = readimage(w) a=imread(w); b = double(a); -
请在Matlab命令窗口中运行
which readimage检查函数在路径上是否可见。如果没有,请将目录更改为您存储 readimage 的位置,或将该目录添加到路径(在菜单文件中)。
标签: matlab