Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
who to make code in gui work in any image the user input?
조회 수: 1 (최근 30일)
이전 댓글 표시
[Filename,Pathname]=uigetfile('*.jpg','load image');
name=strcat(Pathname,Filename);
Filename
a=imread(name);
axes(handles.axes1);
imshow(a);
% --- Executes on button press in test.
function test_Callback(hObject, eventdata, handles)
% hObject handle to test (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
M = xlsread('D:\traindata.xls')
N = xlsread('D:\testdata1.xls')
Training_set = M(1:100,2:10)
%specify training set
Target_set = M(1:100,10)
%specify target set
Testing_set = N(1,2:10)
%index=N(:,10)==0002-1;
%specify Testing set
Testing_Target_Set = N(1,11)
%specify Testing set,Target
%X = mapstd(Training_set');
%Y = mapstd(Target_set');
mynetwork = newrb(Training_set',Target_set',0,0.5,100,25)
%newrb(P,T,goal,spread,MN,DF) takes two of these arguments,
%PR x Q matrix of Q input vectors
%TS x Q matrix of Q target class vectors
%goalMean squared error goal (default = 0.0
%spreadSpread of radial basis functions (default = 1.0
%MNMaximum number of neurons (default is Q)
%DFNumber of neurons to add between displays (default = 25)
mynetwork.trainFcn='trainlm';
mynetwork.trainparam.min_grad=0.00000001;
mynetwork.trainparam.epochs=100;
mynetwork.trainparam.ir=0,4;
mynetwork.trainparam.max_fail=20;
%save mynetwork
D=sim(mynetwork,Testing_set')
%simulate network
xlswrite('D:\testdata1.xls',D',2)
%xlswrite(filename, M, sheet) writes matrix M to the specified worksheet sheet in the file filename
if D==1
L='Not Existing'
set(handles.text3,'String',L);
else D==2
K='Existing'
set(handles.text3,'String',K);
end
댓글 수: 0
답변 (1개)
Walter Roberson
2019년 4월 21일
Same cause as for your slightly earlier and very similar posting.
Do not expect the simulation to output exact integers.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!