-
Notifications
You must be signed in to change notification settings - Fork 0
/
RNFolhas.m
620 lines (463 loc) · 22.2 KB
/
RNFolhas.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
function varargout = RNFolhas(varargin)
% RNFOLHAS MATLAB code for RNFolhas.fig
% RNFOLHAS, by itself, creates a new RNFOLHAS or raises the existing
% singleton*.
%
% H = RNFOLHAS returns the handle to a new RNFOLHAS or the handle to
% the existing singleton*.
%
% RNFOLHAS('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in RNFOLHAS.M with the given input arguments.
%
% RNFOLHAS('Property','Value',...) creates a new RNFOLHAS or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before RNFolhas_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to RNFolhas_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help RNFolhas
% Last Modified by GUIDE v2.5 08-Jul-2018 15:37:33
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @RNFolhas_OpeningFcn, ...
'gui_OutputFcn', @RNFolhas_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before RNFolhas is made visible.
function RNFolhas_OpeningFcn(hObject, eventdata, handles, varargin)
addpath(genpath('./Functions'));
addpath(genpath('./Excell and Manipulation Function'));
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to RNFolhas (see VARARGIN)
% Choose default command line output for RNFolhas
handles.output = hObject;
%Variables
handles.scale = 175;
handles.path_to_files = './Tema 1 - RN/';
handles.data_file = '.\Tema 1 - RN\ClassificaçãoFolhas.xlsx';
%Train Variables
handles.currentTrainNN = 'EMPTY';
%Simulation Variables
handles.currentSimulationNN = 'EMPTY';
handles.hasData = 0;
handles.dataSetUsed = 'EMPTY';
handles.SimulationUsed = 'EMPTY';
handles.nrFolhas = 0;
handles.especiesCertas = 0;
handles.subEspeciesCertas = 0;
handles.time = 0;
%Classificaion Variable
handles.currentClassificationNN = 'EMPTY';
handles.currentImage = 'EMPTY';
handles.dataTable.ColumnName = {'Obtidas: Especie','SubEspecie', 'Targets: Especie','SubEspecie'};
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes RNFolhas wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = RNFolhas_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in bt_useNN.
function bt_useNN_Callback(hObject, eventdata, handles)
% hObject handle to bt_useNN (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[file,path] = uigetfile('*.mat');
try
NN = load([path file]);
NN = NN.NN;
catch exception
NN = 'EMPTY';
errordlg('Por favor carregue uma rede neuronal','NN not found');
end
if strcmp(NN, 'EMPTY') ~= 1
handles.currentClassificationNN = NN;
guidata(hObject, handles);
end
% --- Executes on button press in bt_loadImage.
function bt_loadImage_Callback(hObject, eventdata, handles)
% hObject handle to bt_loadImage (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if strcmp(handles.currentClassificationNN, 'EMPTY') == 1
errordlg('Por favor carregue uma rede primeiro','NN not found');
else
[file, path]=uigetfile('*.jpg*','Specify an image file','on');
image=fullfile(path,file);
handles.currentImage = ConverterImagemParaMatrizBinaria([path file], handles.scale);
guidata(hObject, handles);
imshow(image); %not even calling axes and it works WTF????
end
% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in bt_loadNN.
function bt_loadNN_Callback(hObject, eventdata, handles)
% hObject handle to bt_loadNN (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[file,path] = uigetfile('*.mat');
try
NN = load([path file]);
NN = NN.NN;
catch exception
NN = 'EMPTY';
errordlg('Por favor carregue uma rede neuronal','NN not found');
end
if strcmp(NN, 'EMPTY') ~= 1
handles.currentSimulationNN = NN;
end
handles.hasData = 0;
guidata(hObject, handles);
% --- Executes on selection change in pop_dataset.
function pop_dataset_Callback(hObject, eventdata, handles)
% hObject handle to pop_dataset (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns pop_dataset contents as cell array
% contents{get(hObject,'Value')} returns selected item from pop_dataset
% --- Executes during object creation, after setting all properties.
function pop_dataset_CreateFcn(hObject, eventdata, handles)
% hObject handle to pop_dataset (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in bt_simNN.
function bt_simNN_Callback(hObject, eventdata, handles)
% hObject handle to bt_simNN (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if strcmp(handles.currentSimulationNN, 'EMPTY') == 1
errordlg('Por favor carregue uma rede primeiro','NN not found');
handles.hasData = 0;
else
set(handles.figure1, 'pointer', 'watch')
drawnow;
handles.hasData = 1;
NN = handles.currentSimulationNN;
handles.SimulationUsed = NN;
selectedDataset = get(handles.pop_dataset,'String');
selectedDataset = selectedDataset(get(handles.pop_dataset,'Value'),:);
selectedDataset = strcat(handles.path_to_files, selectedDataset);
handles.dataSetUsed = selectedDataset;
imagens = LoadImages(selectedDataset{1,1}, handles.scale);
imagens = UpdateImages(imagens,handles.data_file, handles.scale);
%- Input and Output Generation
input = inputfromImageExtration(imagens, handles.scale);
target = targetCodigoSubEspecie(imagens);
tstart = tic;%timer
output = NN(input);
handles.time = toc(tstart);
[species subSpecies codeSpecies codeSubEspecies connection] = ClassificationExtration(handles.data_file);
count = size(input);
count = count(1,2);
handles.nrFolhas = count;
Ecertas = 0;
Eerradas = 0;
Subcertas = 0;
Suberradas = 0;
colergen = @(color,text) ['<html><table border=0 width=400 bgcolor=',color,'><TR><TD>',text,'</TD></TR> </table></html>'];
%output = nnOutputToSpecieCode (output, species);
for i = 1 : count
[REspecie RsubEspecie] = nnOutputToSpecieCode(output(:,i), subSpecies, connection);
[TEspecie TsubEspecie] = nnOutputToSpecieCode(target(:,i), subSpecies, connection);
if strcmp(RsubEspecie, TsubEspecie) == 1
d{i, 2} = colergen('#9ACD32',RsubEspecie{1,1});
d{i, 4} = colergen('#9ACD32',TsubEspecie{1,1});
Subcertas = Subcertas + 1;
else
d{i, 2} = colergen('#FF4500',RsubEspecie{1,1});
d{i, 4} = colergen('#FF4500',TsubEspecie{1,1});
Suberradas = Suberradas + 1;
end
if strcmp(REspecie, TEspecie) == 1
d{i, 1} = colergen('#9ACD32',REspecie{1,1});
d{i, 3} = colergen('#9ACD32',TEspecie{1,1});
Ecertas = Ecertas + 1;
else
d{i, 1} = colergen('#FF4500',REspecie{1,1});
d{i, 3} = colergen('#FF4500',TEspecie{1,1});
Eerradas = Eerradas + 1;
end
end
handles.especiesCertas = Ecertas;
handles.subEspeciesCertas = Subcertas;
%display(d);
handles.dataTable.Data = d;
set(handles.text19, 'String', Ecertas);
set(handles.text20, 'String', Eerradas);
set(handles.text26, 'String', Subcertas);
set(handles.text27, 'String', Suberradas);
y = [Ecertas/count Eerradas/count ; Subcertas/count Suberradas/count ];
b = bar(handles.axes5,y);
set(handles.figure1, 'pointer', 'arrow')
end
guidata(hObject, handles);
% --- Executes on selection change in pop_topologia.
function pop_topologia_Callback(hObject, eventdata, handles)
% hObject handle to pop_topologia (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns pop_topologia contents as cell array
% contents{get(hObject,'Value')} returns selected item from pop_topologia
% --- Executes during object creation, after setting all properties.
function pop_topologia_CreateFcn(hObject, eventdata, handles)
% hObject handle to pop_topologia (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on selection change in pop_fAtivacao.
function pop_fAtivacao_Callback(hObject, eventdata, handles)
% hObject handle to pop_fAtivacao (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns pop_fAtivacao contents as cell array
% contents{get(hObject,'Value')} returns selected item from pop_fAtivacao
% --- Executes during object creation, after setting all properties.
function pop_fAtivacao_CreateFcn(hObject, eventdata, handles)
% hObject handle to pop_fAtivacao (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in bt_trainNN.
function bt_trainNN_Callback(hObject, eventdata, handles)
% hObject handle to bt_trainNN (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Loaded from GUI
set(handles.figure1, 'pointer', 'watch')
drawnow;
all_topologias = get(handles.pop_topologia,'String');
NNparam.topologia = all_topologias(get(handles.pop_topologia,'Value'),:);
NNparam.topologia = NNparam.topologia{1,1};
all_fAtivacao = get(handles.pop_fAtivacao,'String');
NNparam.fAtivacao = all_fAtivacao(get(handles.pop_fAtivacao,'Value'),:);
NNparam.fAtivacao = NNparam.fAtivacao{1,1};
all_fTreino = get(handles.pop_fTreino,'String');
NNparam.fTreino = all_fTreino(get(handles.pop_fTreino,'Value'),:);
NNparam.fTreino = NNparam.fTreino{1,1};
selectedDataset = get(handles.pop_trainData,'String');
selectedDataset = selectedDataset(get(handles.pop_trainData,'Value'),:);
selectedDataset = strcat(handles.path_to_files, selectedDataset);
hiddenLayers = get(handles.slider_layers,'Value');
hiddenLayers = floor(hiddenLayers)
neurons = get(handles.slider_neurons,'Value');
neurons = floor(neurons)
A(1:1,1:hiddenLayers) = neurons;
%Default param
NNparam.neuronios = A;
NNparam.trainRatio = 0.7;
NNparam.valRatio = 0.15;
NNparam.testRatio = 0.15;
NNparam.max_fail = 10;
imagens = LoadImages(selectedDataset{1,1}, handles.scale);
imagens = UpdateImages(imagens,handles.data_file, handles.scale);
%- Input and Output Generation
input = inputfromImageExtration(imagens, handles.scale);
target = targetCodigoSubEspecie(imagens);
[currentTrainNN data pTotal pTeste] = NeuralNetwork(NNparam, input, target);
handles.currentTrainNN = currentTrainNN;
set(handles.txt_pTotal, 'String', pTotal);
set(handles.txt_pTeste, 'String', pTeste);
% your computation
set(handles.figure1, 'pointer', 'arrow')
% Update handles structure
guidata(hObject, handles);
%view(redeNeuronal);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% --- Executes on selection change in pop_fTreino.
function pop_fTreino_Callback(hObject, eventdata, handles)
% hObject handle to pop_fTreino (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns pop_fTreino contents as cell array
% contents{get(hObject,'Value')} returns selected item from pop_fTreino
% --- Executes during object creation, after setting all properties.
function pop_fTreino_CreateFcn(hObject, eventdata, handles)
% hObject handle to pop_fTreino (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in bt_saveNN.
function bt_saveNN_Callback(hObject, eventdata, handles)
% hObject handle to bt_saveNN (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if strcmp(handles.currentTrainNN, 'EMPTY') == 1
errordlg('Por favor treine uma rede primeiro','NN not found');
else
old_dir = pwd;
cd (handles.path_to_files);
nr_files=dir(['*.mat']);
nr_files=size(nr_files,1);
nr_files=num2str(nr_files);
name = {['NN', nr_files]};
name = name{1,1};
NN = handles.currentTrainNN;
save(name,'NN');
cd (old_dir);
end
% --- Executes on button press in bt_class.
function bt_class_Callback(hObject, eventdata, handles)
% hObject handle to bt_class (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if strcmp(handles.currentImage, 'EMPTY') == 1
errordlg('Por favor carregue uma imagem primeiro','NN not found');
else
[species subSpecies codeSpecies codeSubEspecies connection] = ClassificationExtration(handles.data_file);
net = handles.currentClassificationNN;
%input = inputfromImageExtration(handles.currentImage, handles.scale);
%Image Extration of Features
inputSize = net.inputs.size;
inputSize = inputSize{1,1};
points = detectHarrisFeatures(handles.currentImage);
points = points.selectStrongest(inputSize/2).Location;
points = points(:);
output = net(points);
[REspecie RsubEspecie] = nnOutputToSpecieCode(output, subSpecies, connection);
set(handles.edit1, 'String', REspecie{1,1});
set(handles.edit2, 'String', RsubEspecie{1,1});
end
% --- Executes during object creation, after setting all properties.
function imageDisplay_CreateFcn(hObject, eventdata, handles)
% hObject handle to imageDisplay (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate imageDisplay
% --- Executes on selection change in pop_trainData.
function pop_trainData_Callback(hObject, eventdata, handles)
% hObject handle to pop_trainData (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns pop_trainData contents as cell array
% contents{get(hObject,'Value')} returns selected item from pop_trainData
% --- Executes during object creation, after setting all properties.
function pop_trainData_CreateFcn(hObject, eventdata, handles)
% hObject handle to pop_trainData (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on slider movement.
function slider_neurons_Callback(hObject, eventdata, handles)
% hObject handle to slider_neurons (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.text33, 'String', floor(get(handles.slider_neurons,'Value')));
% --- Executes during object creation, after setting all properties.
function slider_neurons_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider_neurons (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% --- Executes on slider movement.
function slider_layers_Callback(hObject, eventdata, handles)
% hObject handle to slider_layers (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
set(handles.text32, 'String', floor(get(handles.slider_layers,'Value')));
% --- Executes during object creation, after setting all properties.
function slider_layers_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider_layers (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% --- Executes on button press in btn_save.
function btn_save_Callback(hObject, eventdata, handles)
% hObject handle to btn_save (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if handles.hasData == 0
errordlg('Verifique se os dados existem ou se ja foram gravados','NN not found');
else
handles.hasData = 0;
savedData.dataSetUsed = handles.dataSetUsed;
savedData.SimulationUsed = handles.SimulationUsed;
savedData.nrFolhas = handles.nrFolhas;
savedData.especiesCertas = handles.especiesCertas;
savedData.subEspeciesCertas = handles.subEspeciesCertas;
savedData.time = handles.time;
writeData(savedData);
end
guidata(hObject, handles);