error in displaying image

조회 수: 7 (최근 30일)
kash
kash 2012년 5월 2일
I have a code
function pbRecognize_Callback(hObject, eventdata, handles)
% hObject handle to pbRecognize (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
charvec = handles.charvec;
selected_net = get(handles.editNN,'string');
selected_net = evalin('base',selected_net);
result = sim(selected_net,charvec);
[val, num] = max(result);
set(handles.editResult, 'string',num);
i tried sing the code without using GUI BUT I GET ERROR ,UNDEFINED VARIABLE selected_net
PLEASE HELP

답변 (1개)

Image Analyst
Image Analyst 2012년 5월 2일
Why do you have this line:
selected_net = evalin('base',selected_net);
when you've just retrieved it from the "editNN" edit text box? Where is selected_net supposed to originate? Also, I don't see where it's trying to display an image (no image(), imagesc() or imshow()). Did you modify the downloaded code in any way? Did you try to contact the author?

Community Treasure Hunt

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

Start Hunting!

Translated by