error in displaying image

8 次查看(过去 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