Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/jmrplens/EASEPostFile2Matlab. Representa los datos de historia temporal obtenidos con EASE 4 y calcula la teoría revisada corregida.
···11+function varargout = EASEPostFile2Matlab(varargin)
22+% EASEPOSTFILE2MATLAB MATLAB code for EASEPostFile2Matlab.fig
33+% EASEPOSTFILE2MATLAB, by itself, creates a new EASEPOSTFILE2MATLAB or raises the existing
44+% singleton*.
55+%
66+% H = EASEPOSTFILE2MATLAB returns the handle to a new EASEPOSTFILE2MATLAB or the handle to
77+% the existing singleton*.
88+%
99+% EASEPOSTFILE2MATLAB('CALLBACK',hObject,eventData,handles,...) calls the local
1010+% function named CALLBACK in EASEPOSTFILE2MATLAB.M with the given input arguments.
1111+%
1212+% EASEPOSTFILE2MATLAB('Property','Value',...) creates a new EASEPOSTFILE2MATLAB or raises the
1313+% existing singleton*. Starting from the left, property value pairs are
1414+% applied to the GUI before EASEPostFile2Matlab_OpeningFcn gets called. An
1515+% unrecognized property name or invalid value makes property application
1616+% stop. All inputs are passed to EASEPostFile2Matlab_OpeningFcn via varargin.
1717+%
1818+% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
1919+% instance to run (singleton)".
2020+%
2121+% See also: GUIDE, GUIDATA, GUIHANDLES
2222+2323+% Edit the above text to modify the response to help EASEPostFile2Matlab
2424+2525+% Last Modified by GUIDE v2.5 18-Apr-2018 01:21:17
2626+2727+% Begin initialization code - DO NOT EDIT
2828+gui_Singleton = 1;
2929+gui_State = struct('gui_Name', mfilename, ...
3030+ 'gui_Singleton', gui_Singleton, ...
3131+ 'gui_OpeningFcn', @EASEPostFile2Matlab_OpeningFcn, ...
3232+ 'gui_OutputFcn', @EASEPostFile2Matlab_OutputFcn, ...
3333+ 'gui_LayoutFcn', [] , ...
3434+ 'gui_Callback', []);
3535+if nargin && ischar(varargin{1})
3636+ gui_State.gui_Callback = str2func(varargin{1});
3737+end
3838+3939+if nargout
4040+ [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
4141+else
4242+ gui_mainfcn(gui_State, varargin{:});
4343+end
4444+% End initialization code - DO NOT EDIT
4545+4646+4747+% --- Executes just before EASEPostFile2Matlab is made visible.
4848+function EASEPostFile2Matlab_OpeningFcn(hObject, eventdata, handles, varargin)
4949+% This function has no output args, see OutputFcn.
5050+% hObject handle to figure
5151+% eventdata reserved - to be defined in a future version of MATLAB
5252+% handles structure with handles and user data (see GUIDATA)
5353+% varargin command line arguments to EASEPostFile2Matlab (see VARARGIN)
5454+5555+% Choose default command line output for EASEPostFile2Matlab
5656+handles.output = hObject;
5757+5858+addpath('include')
5959+6060+% Valor por defecto del tiempo de integracion
6161+handles.Rango = 50; % milisegundos
6262+6363+% Textos de la ventana de carga
6464+handles.LPROGRESSTITLE = 'Progreso';
6565+handles.LTIMEDAYS = 'dias';
6666+handles.LTIMEHOURS = 'horas';
6767+handles.LTIMEMINS = 'mins';
6868+handles.LTIMESECS = 'segs';
6969+handles.LTIMESEC = 'seg';
7070+% Update handles structure
7171+guidata(hObject, handles);
7272+7373+% UIWAIT makes EASEPostFile2Matlab wait for user response (see UIRESUME)
7474+% uiwait(handles.figure1);
7575+7676+7777+% --- Outputs from this function are returned to the command line.
7878+function varargout = EASEPostFile2Matlab_OutputFcn(hObject, eventdata, handles)
7979+% varargout cell array for returning output args (see VARARGOUT);
8080+% hObject handle to figure
8181+% eventdata reserved - to be defined in a future version of MATLAB
8282+% handles structure with handles and user data (see GUIDATA)
8383+8484+% Get default command line output from handles structure
8585+varargout{1} = handles.output;
8686+8787+8888+% --- Executes on button press in botonRT.
8989+function botonRT_Callback(hObject, eventdata, handles)
9090+representaRT(handles)
9191+9292+9393+% --- Executes on selection change in listafuentes.
9494+function listafuentes_Callback(hObject, eventdata, handles)
9595+9696+% --- Executes during object creation, after setting all properties.
9797+function listafuentes_CreateFcn(hObject, eventdata, handles)
9898+if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
9999+ set(hObject,'BackgroundColor','white');
100100+end
101101+set(hObject,'string',[])
102102+103103+% --- Executes on selection change in listareceptores.
104104+function listareceptores_Callback(hObject, eventdata, handles)
105105+handles.Index = get(handles.listareceptores,'Value');
106106+% Receptor
107107+set(handles.posicionreceptortexto,'String',...
108108+ [num2str(handles.SPLm{handles.Index,5}(1)),'x',...
109109+ num2str(handles.SPLm{handles.Index,5}(2)),'x',...
110110+ num2str(handles.SPLm{handles.Index,5}(3))])
111111+set(handles.tiempollegadatexto,'String',num2str(handles.SPLm{handles.Index,9}))
112112+set(handles.distanciafuentetexto,'String',num2str(handles.SPLm{handles.Index,6}))
113113+set(handles.rayosrecibidostexto,'String',num2str(handles.SPLm{handles.Index,8}))
114114+guidata(hObject, handles);
115115+116116+% --- Executes during object creation, after setting all properties.
117117+function listareceptores_CreateFcn(hObject, eventdata, handles)
118118+if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
119119+ set(hObject,'BackgroundColor','white');
120120+end
121121+set(hObject,'string',[])
122122+123123+124124+% --- Executes on button press in botonrespuestafuente.
125125+function botonrespuestafuente_Callback(hObject, eventdata, handles)
126126+representaRespuesta(handles)
127127+128128+129129+% --- Executes on button press in botondirectividadfuente.
130130+function botondirectividadfuente_Callback(hObject, eventdata, handles)
131131+representaDirectividad(handles)
132132+133133+134134+% --- Executes on button press in botonplotear.
135135+function botonplotear_Callback(hObject, eventdata, handles)
136136+137137+% Si esta marcada la opcion de SPL vs Distancia
138138+if get(handles.splVSdist,'Value')==1
139139+ handles.Rango = str2double(get(handles.rangotemporal,'String'));
140140+ % Muestra el mensaje de carga de representacion
141141+ set(handles.cargandoPlot,'visible','on')
142142+ if get(handles.doscampos,'value')==1 % Util/Perjudicial
143143+ representarSPLvsDist2(hObject,handles)
144144+ elseif get(handles.trescampos,'value')==1 % Directo/Early/Late
145145+ representarSPLvsDist3(hObject,handles)
146146+ end
147147+ set(handles.cargandoPlot,'visible','off')
148148+end
149149+if get(handles.ecogramaBoton,'Value')==1
150150+ representarEcograma(handles)
151151+end
152152+if get(handles.claridadboton,'Value')==1
153153+ handles.Rango = str2double(get(handles.rangotemporal,'String'));
154154+ set(handles.cargandoPlot,'visible','on')
155155+ representarCt(hObject,handles)
156156+ set(handles.cargandoPlot,'visible','off')
157157+end
158158+if get(handles.definicionboton,'Value')==1
159159+ handles.Rango = str2double(get(handles.rangotemporal,'String'));
160160+ set(handles.cargandoPlot,'visible','on')
161161+ representarDt(hObject,handles)
162162+ set(handles.cargandoPlot,'visible','off')
163163+end
164164+if get(handles.sonoridadboton,'Value')==1
165165+ set(handles.cargandoPlot,'visible','on')
166166+ representarG(hObject,handles)
167167+ set(handles.cargandoPlot,'visible','off')
168168+end
169169+170170+171171+172172+% --- Executes on button press in abrirnuevafigura.
173173+function abrirnuevafigura_Callback(hObject, eventdata, handles)
174174+% hObject handle to abrirnuevafigura (see GCBO)
175175+% eventdata reserved - to be defined in a future version of MATLAB
176176+% handles structure with handles and user data (see GUIDATA)
177177+178178+179179+% --- Executes on button press in botonExportar.
180180+function botonExportar_Callback(hObject, eventdata, handles)
181181+% hObject handle to botonExportar (see GCBO)
182182+% eventdata reserved - to be defined in a future version of MATLAB
183183+% handles structure with handles and user data (see GUIDATA)
184184+185185+186186+187187+function rangotemporal_Callback(hObject, eventdata, handles)
188188+MaxElegible = handles.MaxElegible;
189189+Valor = str2double(get(hObject,'String'));
190190+set(hObject,'String',num2str(floor(Valor)))
191191+if str2double(get(hObject,'String')) > MaxElegible
192192+ set(hObject,'String',num2str(floor(MaxElegible)))
193193+end
194194+if str2double(get(hObject,'String'))<2
195195+ set(hObject,'String','2')
196196+end
197197+198198+199199+% --- Executes during object creation, after setting all properties.
200200+function rangotemporal_CreateFcn(hObject, eventdata, handles)
201201+% hObject handle to rangotemporal (see GCBO)
202202+% eventdata reserved - to be defined in a future version of MATLAB
203203+% handles empty - handles not created until after all CreateFcns called
204204+205205+% Hint: edit controls usually have a white background on Windows.
206206+% See ISPC and COMPUTER.
207207+if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
208208+ set(hObject,'BackgroundColor','white');
209209+end
210210+211211+212212+% --- Executes on button press in generarvideoboton.
213213+function generarvideoboton_Callback(hObject, eventdata, handles)
214214+% hObject handle to generarvideoboton (see GCBO)
215215+% eventdata reserved - to be defined in a future version of MATLAB
216216+% handles structure with handles and user data (see GUIDATA)
217217+218218+% Hint: get(hObject,'Value') returns toggle state of generarvideoboton
219219+220220+221221+222222+function limvideoms_Callback(hObject, eventdata, handles)
223223+MaxElegible = handles.MaxElegible;
224224+Valor = str2double(get(hObject,'String'));
225225+set(hObject,'String',num2str(floor(Valor)))
226226+if str2double(get(hObject,'String')) > MaxElegible
227227+ set(hObject,'String',num2str(floor(MaxElegible)))
228228+end
229229+if str2double(get(hObject,'String'))==0
230230+ set(hObject,'String','1')
231231+end
232232+233233+234234+% --- Executes during object creation, after setting all properties.
235235+function limvideoms_CreateFcn(hObject, eventdata, handles)
236236+% hObject handle to limvideoms (see GCBO)
237237+% eventdata reserved - to be defined in a future version of MATLAB
238238+% handles empty - handles not created until after all CreateFcns called
239239+240240+% Hint: edit controls usually have a white background on Windows.
241241+% See ISPC and COMPUTER.
242242+if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
243243+ set(hObject,'BackgroundColor','white');
244244+end
245245+246246+247247+% --------------------------------------------------------------------
248248+function menuinicio_Callback(hObject, eventdata, handles)
249249+% hObject handle to menuinicio (see GCBO)
250250+% eventdata reserved - to be defined in a future version of MATLAB
251251+% handles structure with handles and user data (see GUIDATA)
252252+253253+254254+% --------------------------------------------------------------------
255255+function botonleerarchivos_Callback(hObject, eventdata, handles)
256256+% Solicita los archivos
257257+[NombreArchivo,Ruta] = uigetfile(...
258258+ '*.*',...
259259+ 'Elige los archivos ''Post File''',...
260260+ 'MultiSelect', 'on');
261261+if isempty(NombreArchivo); return; end
262262+% Genera la ruta hacia los archivos
263263+for i=1:size(NombreArchivo,2)
264264+ handles.ListaArchivos(i) = strcat(Ruta,NombreArchivo(i));
265265+end
266266+267267+UltimaCarpeta = find(Ruta==filesep,2,'last');
268268+TituloCarpeta = Ruta(UltimaCarpeta(1):end);
269269+handles.figure1.Name = ['EASEPostFile2Matlab',' (...',TituloCarpeta,')'];
270270+271271+% Importa los archivos
272272+importarPostFiles(hObject,handles)
273273+274274+% Carga las nuevas variables
275275+handles = guidata(hObject);
276276+277277+% Carga de datos inicial
278278+% Extraer cada ID de fuente diferente. Sirve para tener identificada cada
279279+% fuente y para conocer el numero de fuentes.
280280+handles.Fuentes = unique(handles.SPLm(:,2));
281281+282282+% Indice de inicio de cada fuente
283283+[~, handles.FuentesIni] = unique(handles.SPLm(:,2),'first');
284284+% Indice de final de cada fuente
285285+[~, handles.FuentesFin] = unique(handles.SPLm(:,2),'last');
286286+287287+% Indice de los datos inicial
288288+handles.Index = 1;
289289+290290+% Array de nombres de receptores
291291+handles.Receptores = handles.SPLm(...
292292+ handles.FuentesIni(handles.Index):handles.FuentesFin(handles.Index),...
293293+ 3);
294294+295295+% Actualiza los valores mostrados en la aplicaci�n
296296+% Sala
297297+set(handles.volumentexto,'String',num2str(handles.SPLm{handles.Index,15}))
298298+set(handles.superficietexto,'String',num2str(handles.SPLm{handles.Index,16}))
299299+set(handles.temperaturatexto,'String',num2str(handles.SPLm{handles.Index,17}))
300300+set(handles.humedadtexto,'String',num2str(handles.SPLm{handles.Index,18}))
301301+% Fuente
302302+set(handles.posicionfuentetexto,'String',...
303303+ [num2str(handles.SPLm{handles.Index,4}(1)),'x',...
304304+ num2str(handles.SPLm{handles.Index,4}(2)),'x',...
305305+ num2str(handles.SPLm{handles.Index,4}(3))])
306306+set(handles.retardofuentetexto,'String',num2str(handles.SPLm{handles.Index,7}))
307307+% Receptor
308308+set(handles.posicionreceptortexto,'String',...
309309+ [num2str(handles.SPLm{handles.Index,5}(1)),'x',...
310310+ num2str(handles.SPLm{handles.Index,5}(2)),'x',...
311311+ num2str(handles.SPLm{handles.Index,5}(3))])
312312+set(handles.tiempollegadatexto,'String',num2str(handles.SPLm{handles.Index,9}))
313313+set(handles.distanciafuentetexto,'String',num2str(handles.SPLm{handles.Index,6}))
314314+set(handles.rayosrecibidostexto,'String',num2str(handles.SPLm{handles.Index,8}))
315315+% Lista receptores
316316+set(handles.listareceptores,'string',handles.Receptores)
317317+% Lista fuentes
318318+set(handles.listafuentes,'string',handles.Fuentes)
319319+320320+% Actualiza el valor maximo elegible
321321+set(handles.ValMaxText,'String',num2str(floor(handles.MaxElegible)));
322322+323323+324324+% Mostrar detalles del programa
325325+set(handles.panelparametrossala,'visible','on')
326326+set(handles.panelfuente,'visible','on')
327327+set(handles.panellistafuentes,'visible','on')
328328+set(handles.panellistareceptores,'visible','on')
329329+set(handles.panelparametrosreceptor,'visible','on')
330330+set(handles.paneltemporal,'visible','on')
331331+set(handles.botonplotear,'visible','on')
332332+333333+% Actualizar variables en la aplicacion
334334+guidata(hObject, handles);
335335+336336+337337+% --- Executes on button press in botonAbsorcion.
338338+function botonAbsorcion_Callback(hObject, eventdata, handles)
339339+representaAbsorcion(handles)
340340+341341+342342+% --- Executes on button press in teoriacorregida.
343343+function teoriacorregida_Callback(hObject, eventdata, handles)
344344+% hObject handle to teoriacorregida (see GCBO)
345345+% eventdata reserved - to be defined in a future version of MATLAB
346346+% handles structure with handles and user data (see GUIDATA)
347347+348348+% Hint: get(hObject,'Value') returns toggle state of teoriacorregida
349349+350350+351351+352352+function Qdir_Callback(hObject, eventdata, handles)
353353+%Valor = str2double(get(hObject,'String'));
354354+%set(hObject,'String',num2str(floor(Valor)))
355355+if str2double(get(hObject,'String')) < 1
356356+ set(hObject,'String','1')
357357+end
358358+359359+360360+% --- Executes during object creation, after setting all properties.
361361+function Qdir_CreateFcn(hObject, eventdata, handles)
362362+% hObject handle to Qdir (see GCBO)
363363+% eventdata reserved - to be defined in a future version of MATLAB
364364+% handles empty - handles not created until after all CreateFcns called
365365+366366+% Hint: edit controls usually have a white background on Windows.
367367+% See ISPC and COMPUTER.
368368+if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
369369+ set(hObject,'BackgroundColor','white');
370370+end
371371+372372+373373+374374+function numIntentos_Callback(hObject, eventdata, handles)
375375+Valor = str2double(get(hObject,'String'));
376376+set(hObject,'String',num2str(floor(Valor)))
377377+if str2double(get(hObject,'String')) < 10
378378+ set(hObject,'String','10')
379379+end
380380+381381+382382+% --- Executes during object creation, after setting all properties.
383383+function numIntentos_CreateFcn(hObject, eventdata, handles)
384384+% hObject handle to numIntentos (see GCBO)
385385+% eventdata reserved - to be defined in a future version of MATLAB
386386+% handles empty - handles not created until after all CreateFcns called
387387+388388+% Hint: edit controls usually have a white background on Windows.
389389+% See ISPC and COMPUTER.
390390+if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
391391+ set(hObject,'BackgroundColor','white');
392392+end
393393+394394+395395+% --- Executes on button press in ecogramaBoton.
396396+function ecogramaBoton_Callback(hObject, eventdata, handles)
397397+% hObject handle to ecogramaBoton (see GCBO)
398398+% eventdata reserved - to be defined in a future version of MATLAB
399399+% handles structure with handles and user data (see GUIDATA)
400400+401401+% Hint: get(hObject,'Value') returns toggle state of ecogramaBoton
402402+403403+404404+% --------------------------------------------------------------------
405405+function botonimportarmat_Callback(hObject, eventdata, handles)
406406+% Solicita los archivos
407407+[NombreArchivo,Ruta] = uigetfile(...
408408+ '*.mat',...
409409+ 'Selecciona el archivo .mat');
410410+411411+Archivo = strcat(Ruta,NombreArchivo);
412412+413413+DatosCargados = load(Archivo);
414414+415415+UltimaCarpeta = find(Ruta==filesep,2,'last');
416416+TituloCarpeta = Ruta(UltimaCarpeta(1):end);
417417+handles.figure1.Name = ['EASEPostFile2Matlab',' (...',TituloCarpeta,NombreArchivo,')'];
418418+419419+handles.SPLm = DatosCargados.SPLm;
420420+handles.MaxElegible = DatosCargados.MaxElegible;
421421+422422+% Carga de datos inicial
423423+% Extraer cada ID de fuente diferente. Sirve para tener identificada cada
424424+% fuente y para conocer el numero de fuentes.
425425+handles.Fuentes = unique(handles.SPLm(:,2));
426426+427427+% Indice de inicio de cada fuente
428428+[~, handles.FuentesIni] = unique(handles.SPLm(:,2),'first');
429429+% Indice de final de cada fuente
430430+[~, handles.FuentesFin] = unique(handles.SPLm(:,2),'last');
431431+432432+% Indice de los datos inicial
433433+handles.Index = 1;
434434+435435+% Array de nombres de receptores
436436+handles.Receptores = handles.SPLm(...
437437+ handles.FuentesIni(handles.Index):handles.FuentesFin(handles.Index),...
438438+ 3);
439439+440440+% Actualiza los valores mostrados en la aplicaci�n
441441+% Sala
442442+set(handles.volumentexto,'String',num2str(handles.SPLm{handles.Index,15}))
443443+set(handles.superficietexto,'String',num2str(handles.SPLm{handles.Index,16}))
444444+set(handles.temperaturatexto,'String',num2str(handles.SPLm{handles.Index,17}))
445445+set(handles.humedadtexto,'String',num2str(handles.SPLm{handles.Index,18}))
446446+% Fuente
447447+set(handles.posicionfuentetexto,'String',...
448448+ [num2str(handles.SPLm{handles.Index,4}(1)),'x',...
449449+ num2str(handles.SPLm{handles.Index,4}(2)),'x',...
450450+ num2str(handles.SPLm{handles.Index,4}(3))])
451451+set(handles.retardofuentetexto,'String',num2str(handles.SPLm{handles.Index,7}))
452452+% Receptor
453453+set(handles.posicionreceptortexto,'String',...
454454+ [num2str(handles.SPLm{handles.Index,5}(1)),'x',...
455455+ num2str(handles.SPLm{handles.Index,5}(2)),'x',...
456456+ num2str(handles.SPLm{handles.Index,5}(3))])
457457+set(handles.tiempollegadatexto,'String',num2str(handles.SPLm{handles.Index,9}))
458458+set(handles.distanciafuentetexto,'String',num2str(handles.SPLm{handles.Index,6}))
459459+set(handles.rayosrecibidostexto,'String',num2str(handles.SPLm{handles.Index,8}))
460460+% Lista receptores
461461+set(handles.listareceptores,'string',handles.Receptores)
462462+% Lista fuentes
463463+set(handles.listafuentes,'string',handles.Fuentes)
464464+465465+% Actualiza el valor maximo elegible
466466+set(handles.ValMaxText,'String',num2str(floor(handles.MaxElegible)));
467467+468468+% Mostrar detalles del programa
469469+set(handles.panelparametrossala,'visible','on')
470470+set(handles.panelfuente,'visible','on')
471471+set(handles.panellistafuentes,'visible','on')
472472+set(handles.panellistareceptores,'visible','on')
473473+set(handles.panelparametrosreceptor,'visible','on')
474474+set(handles.paneltemporal,'visible','on')
475475+set(handles.botonplotear,'visible','on')
476476+477477+% Actualizar variables en la aplicacion
478478+guidata(hObject, handles);
479479+480480+481481+% --------------------------------------------------------------------
482482+function exportarmenu_Callback(hObject, eventdata, handles)
483483+% hObject handle to exportarmenu (see GCBO)
484484+% eventdata reserved - to be defined in a future version of MATLAB
485485+% handles structure with handles and user data (see GUIDATA)
486486+487487+488488+% --------------------------------------------------------------------
489489+function exportmatboton_Callback(hObject, eventdata, handles)
490490+[file,path,~] = uiputfile({...
491491+ '*.mat','MAT-files (*.mat)'; % 1 - JPEG
492492+ },'Guardar datos','Datos.mat');
493493+494494+if file==0; return; end
495495+SPLm=handles.SPLm;
496496+MaxElegible = handles.MaxElegible;
497497+% Guarda los datos importados de los TXT en .mat
498498+save([path,file],'SPLm','MaxElegible')
499499+500500+% Si se ha calculado la teoria revisada se exportan el resto de datos
501501+if isfield(handles,'Elate')
502502+503503+ % Coeficientes
504504+ eL = handles.Elate;
505505+ CL = handles.Clate;
506506+ eE = handles.Eearly;
507507+ CE = handles.Cearly;
508508+ CD = handles.Cdirect;
509509+510510+ % Parametros
511511+ SPL = handles.SPL; % Nivel de presion a 1 metro
512512+ W = handles.W; % Potencia
513513+ Q = handles.Q; % Directividad
514514+ t = handles.t; % Rango temporal en segundos
515515+ T = handles.T; % Tiempo de reverberaci�n de Eyring
516516+ c = handles.c; % Velocidad de sonido
517517+ S = handles.S; % Superficie
518518+ V = handles.V; % Volumen
519519+ alpha = handles.alpha; % Coeficiente de absorcion medio
520520+ Z = handles.Z; % Impedancia del aire
521521+ rho = handles.rho; % Densidad del aire
522522+ A = handles.A; % Absorcion equivalente de Eyring
523523+ RTmid = mean([handles.SPLm{1,10}(8),...
524524+ handles.SPLm{1,10}(11),...
525525+ handles.SPLm{1,10}(14)]);
526526+527527+ % Curvas
528528+ Dist = handles.Distancia; % Vector de distancia
529529+ EaseU = handles.EaseU; % Curva del campo util (EASE)
530530+ EaseP = handles.EaseP; % Curva del campo perjudicial (EASE)
531531+ TeoU = handles.TeoU; % Curva del campo util (Teorico)
532532+ TeoP = handles.TeoP; % Curva del campo perjudicial (Teorico)
533533+ EaseD = handles.EaseD; % Curva del campo directo (EASE)
534534+ EaseE = handles.EaseE; % Curva del campo early (EASE)
535535+ EaseL = handles.EaseL; % Curva del campo late (EASE)
536536+ TeoD = handles.TeoD; % Curva del campo directo (Teorico)
537537+ TeoE = handles.TeoE; % Curva del campo early (Teorico)
538538+ TeoL = handles.TeoL; % Curva del campo late (Teorico)
539539+540540+ if isfield(handles,'DistCorte')
541541+ DistCorte = handles.DistCorte;
542542+ else
543543+ DistCorte = NaN;
544544+ end
545545+ if isfield(handles,'DistCorteTeo')
546546+ DistCorteTeo = handles.DistCorteTeo;
547547+ else
548548+ DistCorteTeo = NaN;
549549+ end
550550+551551+ save([path,file],...
552552+ 'eL','CL','eE','CE','CD',... % Coeficientes
553553+ 'SPL','W','Q','t','T','c','S','V','alpha','Z','rho','A','RTmid',... % Parametros
554554+ 'Dist','EaseU','EaseP','TeoU','TeoP',... % Curvas
555555+ 'EaseD','EaseE','EaseL','TeoD','TeoE','TeoL',... % Curvas 2
556556+ 'DistCorte','DistCorteTeo',... % Puntos de corte
557557+ '-append')
558558+end
559559+msgbox('Los datos se han exportado correctamente','Datos guardados','help','modal')
560560+561561+562562+% --- Executes on button press in frec125.
563563+function frec125_Callback(hObject, eventdata, handles)
564564+% hObject handle to frec125 (see GCBO)
565565+% eventdata reserved - to be defined in a future version of MATLAB
566566+% handles structure with handles and user data (see GUIDATA)
567567+568568+% Hint: get(hObject,'Value') returns toggle state of frec125
569569+570570+571571+% --- Executes on button press in frec250.
572572+function frec250_Callback(hObject, eventdata, handles)
573573+% hObject handle to frec250 (see GCBO)
574574+% eventdata reserved - to be defined in a future version of MATLAB
575575+% handles structure with handles and user data (see GUIDATA)
576576+577577+% Hint: get(hObject,'Value') returns toggle state of frec250
578578+579579+580580+% --- Executes on button press in frec500.
581581+function frec500_Callback(hObject, eventdata, handles)
582582+% hObject handle to frec500 (see GCBO)
583583+% eventdata reserved - to be defined in a future version of MATLAB
584584+% handles structure with handles and user data (see GUIDATA)
585585+586586+% Hint: get(hObject,'Value') returns toggle state of frec500
587587+588588+589589+% --- Executes on button press in frec1000.
590590+function frec1000_Callback(hObject, eventdata, handles)
591591+% hObject handle to frec1000 (see GCBO)
592592+% eventdata reserved - to be defined in a future version of MATLAB
593593+% handles structure with handles and user data (see GUIDATA)
594594+595595+% Hint: get(hObject,'Value') returns toggle state of frec1000
596596+597597+598598+% --- Executes on button press in frec2000.
599599+function frec2000_Callback(hObject, eventdata, handles)
600600+% hObject handle to frec2000 (see GCBO)
601601+% eventdata reserved - to be defined in a future version of MATLAB
602602+% handles structure with handles and user data (see GUIDATA)
603603+604604+% Hint: get(hObject,'Value') returns toggle state of frec2000
605605+606606+607607+% --- Executes on button press in frec4000.
608608+function frec4000_Callback(hObject, eventdata, handles)
609609+% hObject handle to frec4000 (see GCBO)
610610+% eventdata reserved - to be defined in a future version of MATLAB
611611+% handles structure with handles and user data (see GUIDATA)
612612+613613+% Hint: get(hObject,'Value') returns toggle state of frec4000
614614+615615+616616+% --- Executes on button press in frec8000.
617617+function frec8000_Callback(hObject, eventdata, handles)
618618+% hObject handle to frec8000 (see GCBO)
619619+% eventdata reserved - to be defined in a future version of MATLAB
620620+% handles structure with handles and user data (see GUIDATA)
621621+622622+% Hint: get(hObject,'Value') returns toggle state of frec8000
623623+624624+625625+% --- Executes on button press in frecFull.
626626+function frecFull_Callback(hObject, eventdata, handles)
627627+% hObject handle to frecFull (see GCBO)
628628+% eventdata reserved - to be defined in a future version of MATLAB
629629+% handles structure with handles and user data (see GUIDATA)
630630+631631+% Hint: get(hObject,'Value') returns toggle state of frecFull
632632+633633+634634+% --- Executes on button press in botonPerjudicial.
635635+function botonPerjudicial_Callback(hObject, eventdata, handles)
636636+% hObject handle to botonPerjudicial (see GCBO)
637637+% eventdata reserved - to be defined in a future version of MATLAB
638638+% handles structure with handles and user data (see GUIDATA)
639639+640640+% Hint: get(hObject,'Value') returns toggle state of botonPerjudicial
641641+642642+643643+% --- Executes on button press in botonEarly.
644644+function botonEarly_Callback(hObject, eventdata, handles)
645645+% hObject handle to botonEarly (see GCBO)
646646+% eventdata reserved - to be defined in a future version of MATLAB
647647+% handles structure with handles and user data (see GUIDATA)
648648+649649+% Hint: get(hObject,'Value') returns toggle state of botonEarly
650650+651651+652652+% --- Executes on button press in botonDirecto.
653653+function botonDirecto_Callback(hObject, eventdata, handles)
654654+% hObject handle to botonDirecto (see GCBO)
655655+% eventdata reserved - to be defined in a future version of MATLAB
656656+% handles structure with handles and user data (see GUIDATA)
657657+658658+% Hint: get(hObject,'Value') returns toggle state of botonDirecto
659659+660660+661661+% --- Executes on button press in trescampos.
662662+function trescampos_Callback(hObject, eventdata, handles)
663663+% Inhabilita botones que no tienen calculo con los tres campos separados
664664+set(handles.claridadboton,'enable','off')
665665+set(handles.definicionboton,'enable','off')
666666+set(handles.sonoridadboton,'enable','off')
667667+set(handles.ecogramaBoton,'enable','off')
668668+669669+670670+% --- Executes on button press in doscampos.
671671+function doscampos_Callback(hObject, eventdata, handles)
672672+% Habilita los botones
673673+set(handles.claridadboton,'enable','on')
674674+set(handles.definicionboton,'enable','on')
675675+set(handles.sonoridadboton,'enable','on')
676676+set(handles.ecogramaBoton,'enable','on')