[問題]在多個axes上秀圖的問題已回收

看板MATLAB作者 (070)時間16年前 (2009/04/03 11:51), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
程式碼如下 讀圖部分 function open_Callback(hObject, eventdata, handles) [handles.filename, pathname] = uigetfile('*.bmp','請選擇一個檔案'); if isequal(handles.filename,0) disp('User selected Cancel'); else disp(['User selected', fullfile(pathname, handles.filename)]); In = [pathname, handles.filename]; end Orimage=imread(In); %讀取圖像 axes(handles.axes1); %指定顯示圖片的地方 imshow(Orimage); %顯示原圖像 title('原始圖'); axes(handles.axes2); imhist(Orimage); title('原始圖histogram'); guidata(hObject, handles); __________________________________________________________________________ 均化後輸出 function pushbutton1_Callback(hObject, eventdata, handles) Orimage=imread(handles.filename); eqimage=histeq(Orimage); loc=findobj('tag','axes3'); subplot(loc); imshow(eqimage); guidata(hObject, handles); 可是按下BUTTON後,圖會在另一個新的視窗上顯示 且顯示出下列錯誤訊息 Error using ==> guidata H must be the handle to a figure or figure descendent. 請各位幫我看看是哪裡出問題... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.67.141.116 ※ 編輯: bmw1207 來自: 203.67.141.116 (04/03 12:05)

04/07 14:47, , 1F
將兩個call back都加上全域變數就OK了 global Orimage;
04/07 14:47, 1F
文章代碼(AID): #19rOVHl_ (MATLAB)
文章代碼(AID): #19rOVHl_ (MATLAB)