我試圖加載圖像,但它顯示錯誤消息Undefined function or method 'readimage' for input arguments of type 'char'.
未定義的函數或方法「readimage」類型「字符」
我調用的函數是在這裏
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](http://www.mathworks.se/help/techdoc/ref/imread.html)。 –
謝謝。我的readimage函數就像函數b = readimage(w) a = imread(w); b = double(a); ' – Kabir
請在Matlab命令窗口運行'which readimage'來檢查路徑上是否可見該函數。如果沒有,請將目錄更改爲存儲了readimage的任何位置,或將該目錄添加到路徑中(在菜單文件中)。 – Jonas