Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

who to make code in gui work in any image the user input?

1 vue (au cours des 30 derniers jours)
meemee meemee
meemee meemee le 21 Avr 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
[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

Réponses (1)

Walter Roberson
Walter Roberson le 21 Avr 2019
Same cause as for your slightly earlier and very similar posting.
Do not expect the simulation to output exact integers.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by