Error using SampleGUImain>pushbutton2_Callback Too many input arguments.
Code:
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(handles)
imM=im>80;
axes(handles.axes2)
imshow(imM);
title('Threshold Image');

 採用された回答

Image Analyst
Image Analyst 2016 年 9 月 24 日

0 投票

Somehow you got rid of the required input arguments, which should be hObject, eventdata, handles
To fix:
function pushbutton2_Callback(hObject, eventdata, handles)

4 件のコメント

Hazel Sialongo
Hazel Sialongo 2016 年 9 月 24 日
I put that on my code but I got another error.
Error:
Undefined function or variable 'im'.
Image Analyst
Image Analyst 2016 年 9 月 24 日
Of course. I knew you'd find that out. All variables are local unless you make them not local. So where is im defined in that function? It's not. Where did you define it?
Hazel Sialongo
Hazel Sialongo 2016 年 9 月 24 日
I used global im but it has no image output.
Image Analyst
Image Analyst 2016 年 9 月 24 日
Global just declares that the variable is able to be "seen" by that function. It doesn't really have "an output" per se, it just makes the variable able to be seen. Of course if you've never assigned that variable ever before in any function, then it will be undefined. Show me the function where you first assigned a value to im.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by