diff --git a/Dist_tierra_sol.m b/Dist_tierra_sol.m new file mode 100644 index 0000000..41c5594 --- /dev/null +++ b/Dist_tierra_sol.m @@ -0,0 +1,365 @@ +0.9833098 +0.983301 +0.983297 +0.9832983 +0.9833045 +0.9833159 +0.9833324 +0.9833541 +0.9833806 +0.9834126 +0.9834494 +0.9834914 +0.9835384 +0.9835906 +0.9836476 +0.9837098 +0.9837771 +0.9838491 +0.9839263 +0.9840083 +0.9840953 +0.9841869 +0.9842835 +0.984385 +0.9844911 +0.9846018 +0.9847172 +0.9848373 +0.984962 +0.9850912 +0.985225 +0.9853632 +0.9855058 +0.9856527 +0.9858041 +0.9859597 +0.9861195 +0.9862837 +0.9864517 +0.9866241 +0.9868004 +0.9869809 +0.9871652 +0.9873533 +0.9875454 +0.9877412 +0.9879406 +0.9881439 +0.9883506 +0.9885609 +0.9887745 +0.9889913 +0.9892117 +0.9894352 +0.9896619 +0.9898914 +0.990124 +0.9903595 +0.9905978 +0.990839 +0.9910827 +0.9913291 +0.9915781 +0.9918293 +0.9920831 +0.9923392 +0.9925975 +0.9928579 +0.9931204 +0.993385 +0.9936513 +0.9939198 +0.9941899 +0.9944617 +0.9947352 +0.9950101 +0.9952865 +0.9955642 +0.9958431 +0.9961233 +0.9964046 +0.9966869 +0.9969699 +0.9972539 +0.9975385 +0.9978237 +0.9981096 +0.9983957 +0.9986824 +0.9989694 +0.9992566 +0.9995437 +0.999831 +1.0001183 +1.0004053 +1.0006922 +1.0009789 +1.0012652 +1.0015508 +1.0018362 +1.0021209 +1.0024048 +1.0026881 +1.0029706 +1.0032519 +1.0035324 +1.0038117 +1.00409 +1.004367 +1.0046426 +1.0049165 +1.0051893 +1.0054603 +1.0057296 +1.0059972 +1.0062629 +1.0065266 +1.0067884 +1.0070481 +1.0073056 +1.007561 +1.0078142 +1.0080649 +1.0083131 +1.0085586 +1.0088021 +1.0090426 +1.0092806 +1.009516 +1.0097481 +1.0099779 +1.0102047 +1.0104283 +1.0106487 +1.0108663 +1.0110806 +1.0112919 +1.0114996 +1.0117042 +1.0119051 +1.012103 +1.0122969 +1.0124871 +1.012674 +1.0128571 +1.0130363 +1.0132118 +1.0133833 +1.0135511 +1.0137149 +1.0138747 +1.0140301 +1.014182 +1.0143296 +1.0144727 +1.014612 +1.014747 +1.0148779 +1.0150043 +1.0151263 +1.0152442 +1.0153576 +1.0154668 +1.0155715 +1.0156716 +1.0157675 +1.0158585 +1.0159453 +1.0160273 +1.0161048 +1.0161779 +1.016246 +1.0163095 +1.0163685 +1.0164225 +1.0164719 +1.0165166 +1.0165565 +1.0165917 +1.0166219 +1.0166476 +1.0166683 +1.0166844 +1.0166955 +1.0167021 +1.0167037 +1.0167006 +1.0166928 +1.0166801 +1.0166628 +1.0166408 +1.0166137 +1.0165821 +1.0165458 +1.0165049 +1.0164591 +1.0164087 +1.0163537 +1.0162939 +1.0162295 +1.0161604 +1.0160865 +1.016008 +1.0159249 +1.0158373 +1.0157452 +1.0156484 +1.0155472 +1.0154413 +1.0153309 +1.0152164 +1.0150971 +1.0149738 +1.0148461 +1.0147139 +1.0145779 +1.0144373 +1.0142927 +1.0141439 +1.0139912 +1.0138344 +1.0136734 +1.0135089 +1.0133402 +1.0131679 +1.0129914 +1.0128114 +1.0126277 +1.0124402 +1.0122491 +1.0120544 +1.0118562 +1.0116545 +1.0114495 +1.0112408 +1.0110291 +1.0108141 +1.0105957 +1.0103742 +1.0101498 +1.009922 +1.0096917 +1.0094584 +1.0092224 +1.0089833 +1.0087419 +1.0084978 +1.0082511 +1.0080019 +1.0077506 +1.0074971 +1.0072409 +1.0069829 +1.0067228 +1.0064605 +1.0061965 +1.0059305 +1.0056626 +1.0053931 +1.0051219 +1.0048492 +1.0045749 +1.0042992 +1.004022 +1.0037439 +1.0034641 +1.0031835 +1.0029017 +1.0026189 +1.0023354 +1.002051 +1.0017661 +1.0014802 +1.0011941 +1.0009078 +1.0006208 +1.0003334 +1.0000464 +0.999759 +0.9994717 +0.9991842 +0.9988971 +0.9986105 +0.9983239 +0.9980379 +0.9977524 +0.9974675 +0.9971833 +0.9968998 +0.9966171 +0.9963353 +0.9960544 +0.9957749 +0.9954963 +0.9952192 +0.9949431 +0.9946685 +0.9943955 +0.994124 +0.9938541 +0.9935861 +0.9933199 +0.9930556 +0.9927934 +0.9925331 +0.9922752 +0.9920197 +0.9917663 +0.9915152 +0.9912669 +0.9910212 +0.990778 +0.9905376 +0.9903 +0.9900654 +0.9898338 +0.9896051 +0.9893795 +0.9891571 +0.9889379 +0.988722 +0.9885094 +0.9883003 +0.9880945 +0.9878922 +0.9876938 +0.9874987 +0.9873076 +0.9871202 +0.9869368 +0.9867573 +0.9865816 +0.9864101 +0.9862425 +0.9860792 +0.9859204 +0.9857655 +0.9856152 +0.9854692 +0.9853275 +0.9851904 +0.9850579 +0.9849299 +0.9848065 +0.9846876 +0.9845736 +0.9844641 +0.9843594 +0.9842595 +0.9841643 +0.9840739 +0.9839886 +0.9839079 +0.9838321 +0.9837613 +0.9836953 +0.9836344 +0.9835784 +0.9835274 +0.9834815 +0.9834406 +0.9834046 +0.9833739 +0.9833483 +0.9833277 diff --git a/NDVI.m b/NDVI.m new file mode 100644 index 0000000..ece35a9 --- /dev/null +++ b/NDVI.m @@ -0,0 +1,37 @@ +pwd +%definir directorio de trabajo +directorio=uigetdir(''); +%setear en este directorio +%Nombre del Proceso +Nombre_Proceso='test'; +%se desean guardar las variables en .mat? 0:no, 1:si +var_mat=0; +Carpeta_output='Output';%salida, guardar resultados +i=1; +Landsat=5; +Carpeta_img=strcat(directorio,'/img_',Nombre_Proceso); +hemisferio='S'; +Banda=4; +[R_l(:,:,1),L_l(:,:,1),DN7(:,:,1),UTM,COD_SAT_IMG,INFO]=reflactancia(Banda,Landsat,Carpeta_img,hemisferio,Nombre_Proceso); +Banda=3; +[R_l(:,:,2),L_l(:,:,2),DN7(:,:,2),UTM,COD_SAT_IMG,INFO]=reflactancia(Banda,Landsat,Carpeta_img,hemisferio,Nombre_Proceso); +Numerador=R_l(:,:,2)-R_l(:,:,1); +Denominador=R_l(:,:,2)+R_l(:,:,1); +valor_NDVI=Numerador./Denominador; +if var_mat==1 +savefile=strcat(Carpeta_output,'/',Nombre_Proceso,'/',COD_SAT_IMG,'.mat'); +save(savefile,'R_l','L_l','DN7','UTM'); +end +I=mat2gray(valor_NDVI,[-1 1]); +[I_16b,Map_16b]=gray2ind(I,65536); +Histograma=imhist(I_16b); +Bit_depth=16;%'BitDepth'= 16 bits +NDVI_16=uint16(valor_NDVI*65535); +savefile_TIF=strcat(Carpeta_output,'/',Nombre_Proceso,'/',COD_SAT_IMG,'.TIF'); +%geotiffwrite(savefile_TIF,valor_NDVI,INFO,'GeoKeyDirectoryTag',UTM.geokey); +geotiffwrite(savefile_TIF,I_16b,INFO,'GeoKeyDirectoryTag',UTM.geokey); +%imwrite(I_16b,savefile_TIF,'tif'); +%Info_tif=imfinfo(savefile_TIF); +savefile_PNG=strcat(Carpeta_output,'/',Nombre_Proceso,'/',COD_SAT_IMG,'.PNG'); +imwrite(I_16b,savefile_PNG,'png'); +Info_png=imfinfo(savefile_PNG); \ No newline at end of file diff --git a/buscar_valor_archivo.m b/buscar_valor_archivo.m new file mode 100644 index 0000000..057bd3a --- /dev/null +++ b/buscar_valor_archivo.m @@ -0,0 +1,34 @@ +function [Valor,NombreVal,n_linea]=buscar_valor_archivo(NombreValor, FilePath) +S=size(NombreValor); +L=S(2); +n=1; +NV={}; +FID=fopen(FilePath); +while ~feof(FID) + leer_linea=fgetl(FID); + %revisa si linea esta vacia o si no es un caracter + if isempty(leer_linea) || ~ischar(leer_linea), break, end + linea=leer_linea; + %leer los elementos de NombreValor a buscar en archivo + %cada linea del archivo es NOMBRE = Valor + %Consiste en extraer linea, buscar string en linea y obtener valor + %N=length(NOMBRE)=5 + %si en linea LN existe, la busqueda entrega a como posicion inical + %Tlin: total caracteres linea + %Valor se obtiene de: [a+N+3,Tlin] + for i=1:L + N=length(char(NombreValor{i})); + a=strfind(linea,char(NombreValor{i})); + if ~isempty(a) + %if n==61 + n_linea(i)=n; + largo_linea=length(linea(1,:)); + NombreVal{i}=linea(a:N+a-1); + NV{i}=linea(a+N+3:largo_linea); + break + end + end + n=n+1; +end +fclose(FID); +Valor=NV; \ No newline at end of file diff --git a/buscarindice.m b/buscarindice.m new file mode 100644 index 0000000..49e6c8e --- /dev/null +++ b/buscarindice.m @@ -0,0 +1,18 @@ +function indice=buscarindice(nombre,lista) +L1=length(lista); + +for i=1:L1 + Buscado=char(nombre); + Obtenido=char(lista(i)); + L_b=length(Buscado); + L_o=length(Obtenido); + if L_b==L_o + if eq(Buscado,Obtenido) + indice=i; + else + indice=[]; + end + end +end + +end \ No newline at end of file diff --git a/get_list_files.m b/get_list_files.m new file mode 100644 index 0000000..d44ee2d --- /dev/null +++ b/get_list_files.m @@ -0,0 +1,10 @@ +%Function to get a list of specific files in a specified directory. +%INPUT: path= Path to the files +% type=type of files being looked, example *.doc % Always write “*.” and then the type of %file +%OUT: OUT=list of name of files in the order given by the OS [nx1] % + +function out=get_list_files(path,type) +ff=fullfile(path,type); +list_dir=dir(fullfile(path,type)); +list_dir={list_dir.name}; +out=list_dir; diff --git a/listar_arbol_directorio.m b/listar_arbol_directorio.m new file mode 100644 index 0000000..e69de29 diff --git a/listar_arbol_directorios.m b/listar_arbol_directorios.m new file mode 100644 index 0000000..5575be2 --- /dev/null +++ b/listar_arbol_directorios.m @@ -0,0 +1,47 @@ +function nietos_Path=listar_nietos_directorio(Directorio_Padre) +cd Directorio_Padre +Hijo=1; +[lista_archivos{Hijo,1} lista_directorios{Hijo,1} lin_dir{Hijo,1} n_linea_dir]=listar_directorio(Directorio_Padre,Hijo); +%lista_archivos es el txt que tiene la lista de todos los archivos en lista +%dentro del directorio actual +%lista_directorios es el txt que tiene la lista de todos los directorios +%hijos del actual +%poner un while (mientras) lar +%leemos lista_directorios +Dir_char='/'; +FID_D=fopen(lista_directorios{Hijo,1},'r') +D=1; +Hijo=2; + while ~feof(FID_D) + FID_A=fopen(lista_archivos{Hijo,1},'r') + leer_linea_D=fgetl(FID_D) + m=n_linea_dir(D); + k=n_linea_dir(D+1); + %siempre k es mayor que m ya que corresponde a una linea posterior + %en lista_archivos + a=1; + while ~feof(FID_A) + leer_linea_A=fgetl(FID_A) + if (k-2)-(m+4)> + nuevo_a=1; + N_A=length(leer_linea_A); + patron=leer_linea_A; + str=' '; + k=strfnd(patron,str); + k_espacio=k(length(k)); + if eq(Dir_char,leer_linea_A(N_A)) + Nuevo_Directorio=leer_linea_A(k_espacio+1,N-1) + Directorio_Padre{Hijo,1}=[Directorio_Padre{Hijo-1,1},'/',Nuevo_Directorio] + [lista_archivos{Hijo,1} lista_directorios{Hijo,1} lin_dir{Hijo,1} n_linea_dir]=listar_directorio(Directorio_Padre,Hijo); + else + Nuevo_Archivo{nuevo_a}=[Directorio_Padre{Hijo-1,1},'/',leer_linea_A(k_espacio+1,N)]; + nuevo_a=nuevo_a+1; + end + end + a=1+a; + end + %guardar archivos txt con nombre nuevo directorio + fclose(FID_A); + end +fclose(FID_D); +end diff --git a/listar_directorio.m b/listar_directorio.m new file mode 100644 index 0000000..28e9f27 --- /dev/null +++ b/listar_directorio.m @@ -0,0 +1,49 @@ +function [lista_archivos lista_directorios es_Directorio n_linea_dir]=listar_directorio(Directorio_Padre,BaseDir,Etapa,Nivel,Log) +cd(BaseDir); +mkdir(Log); +Nombre_Archivo=['lista_nivel_',num2str(Nivel),'_hijo_',num2str(Etapa),'.txt']; +txt_lista=strcat(BaseDir,'/',Log,'/',Nombre_Archivo); +cd(Directorio_Padre); +%se obtiene la lista como string de carpetas(/ al final) y archivos hijos +[status lista]=unix('ls -ahalpi *'); +%pasar txt lista a lista de directorios +fid=fopen(txt_lista,'w+');%crear o abrir archivo lista.txt +%actualizando lista de archivos en directorio +fprintf(fid,lista); +fclose(fid); +lista_archivos=txt_lista; +%abrir archivo para lectura +linea_anterior=''; +i=1; +n_linea=1; +es_Directorio={}; +fid=fopen(lista_archivos,'r'); +while ~feof(fid) + leer_linea=fgetl(fid); + if length(leer_linea)>4 + if eq(leer_linea(1:5),'total') + es_Directorio{i}=linea_anterior(1:length(linea_anterior)-1); + n_linea_dir(i)=n_linea-1; + lin_dir{i,1}=[num2str(n_linea_dir(i)),'|',es_Directorio{i},'\n']; + i=i+1; + end + end + linea_anterior=leer_linea; + n_linea=n_linea+1; +end +n_linea_dir(i)=n_linea+1; +es_Directorio{i}='fin de linea (+1)'; +lin_dir{i,1}=[num2str(n_linea_dir(i)),'|',es_Directorio{i},'\n']; +fclose(fid); +Nombre_Archivo=['lista_nivel_',num2str(Nivel),'_directorios_',num2str(Etapa),'.txt']; +txt_listaD=strcat(BaseDir,'/',Log,'/',Nombre_Archivo) +fid=fopen(txt_listaD,'w+');%crear o abrir aarchivo lista.txt +%actualizando lista de archivos en directorio +[n m]=size(lin_dir); + +for k=1:n + fprintf(fid,lin_dir{k,1}); +end +fclose(fid); +lista_directorios=txt_listaD; +end \ No newline at end of file diff --git a/listar_nietos_directorio.m b/listar_nietos_directorio.m new file mode 100644 index 0000000..473615e --- /dev/null +++ b/listar_nietos_directorio.m @@ -0,0 +1,143 @@ +%[nietos_Path directorios]=listar_nietos_directorio(Directorio_Padre,Nivel) +%Directorio_Padre: entrada string que es el directorio a partir del cual se +%hace el analisis de archivos dnetro de este. +%Nivel es un índice para nombrar los archivos +function [nietos_Path directorios]=listar_nietos_directorio(Directorio_Padre,Nivel) +cd(Directorio_Padre); +cd('..') +BaseDir=pwd; +Log='Logs'; +%Hijo es el numero de Directorio Hijo +cd(Directorio_Padre); +DirectorioInicial=Directorio_Padre; +Hijo=1; +%se analiza directorio padre, entregando las rutas de archivos de texto con +%lista completa y directoios, listado de directorios, numeros de filas en +%que se encuentra cada directorio en archivo de lista completa +[lista_archivos{Hijo,1} lista_directorios{Hijo,1} lin_dir n_linea_dir]=listar_directorio(Directorio_Padre,BaseDir,Hijo,Nivel,Log); +%lista_archivos es el txt que tiene la lista de todos los archivos en lista +%dentro del directorio actual +%lista_directorios es el txt que tiene la lista de todos los directorios +%hijos del actual +%poner un while (mientras) lar +%leemos lista_directorios +%lista_archivos entrega ruta de la lista de archivos obtenidas mediantes ls +%lista_directorios entrega la ruta de la lista d edirectorios +%lin_dir entrega una lista de pares de datos, nro file y fila +%n_linea_dir entrega los nros de fila en que se encuentra cada directorio +%en lista_archivos +Dir_char='/'; +FID_D=fopen(lista_directorios{Hijo,1},'r'); +%%guardar lista de archivos en directorio padre. +txt_lista_NA=strcat(BaseDir,'/',Log,'/','archivos_total.txt'); +D=1; +W=0; +Q=1; +%mientras se lea línea a línea archivo Directorios 'D' + %abre la lista de archivos que es un directorio a un archivo txt + FID_A=fopen(lista_archivos{Hijo,1},'r'); + %mientras A + %variable a, indice de linea en archivo A + %se inicializa contadore de lineas para ARchivo A + nuevo_a=1; + while ~feof(FID_A) + %obtiene linea de A + leer_linea_A=fgetl(FID_A); + %obtiene largo e liena A + N_A=length(leer_linea_A); + %copia la linea en patron para buscar los espacios + %caracter + patron=leer_linea_A; + str=' '; + k_str=strfind(patron,str); + if length(k_str)>=1 + k_espacio=k_str(length(k_str)); + else + k_espacio=0; + end + Archivo_Hijo=leer_linea_A(k_espacio+1:N_A); + %SI Existe una carpeta hija dentro del directorio, + + %se obtienen los valores de línea actual y siguiente directorio + %siempre k es mayor que m ya que corresponde a una linea posterior + %en lista_archivos + + if Q=n_linea_dir(1)-2 && ~strcmp('fin de linea (+1)',Directorio) + %&linealeida=leer_linea_A(N_A) +% NUEVOA=nuevo_a +% M=m +% K=k + %sumamos 1 al indice de pares de directorio +%PARA DIRECTORIOS HIJOS NO OCULTOS + if strcmp(Dir_char,char(leer_linea_A(N_A))) && ~strcmp('./',char(leer_linea_A(N_A-1:N_A))) + %si existe un directorio al interior hay un nuevo + Directorio_Padre=strcat(DirectorioInicial,'/',Directorio); + Nuevo_Directorio=leer_linea_A(k_espacio+1:N_A-1); + Directorio_Hijo=[Directorio_Padre,Dir_char,Nuevo_Directorio]; + Hijo=Hijo+1; + %ejecutar ls sobre nuevo directorio y listar + %archivos y carpetas + %entregando los strings + [lista_archivos{Hijo,1} lista_directorios{Hijo,1} lin_dir_nieto{Hijo,1} n_linea_dir_nieto{Hijo,1}]=listar_directorio(Directorio_Hijo,BaseDir,Hijo,Nivel,Log); +%PARA ARCHIVOS DENTRO DE DIRECTORIO HIJO NO OCULTOS + elseif ~strcmp(Dir_char,char(leer_linea_A(N_A-1:N_A))) && ~strcmp('.',char(leer_linea_A(k_espacio+1))) + %listar los archivos hijos del directorio hijo + Directorio_Padre=strcat(DirectorioInicial,'/',Directorio); + %guardar archivos txt con nombre nuevo + Nuevo_Archivo{nuevo_a,1}=[Directorio_Padre,Dir_char,leer_linea_A(k_espacio+1:N_A),'\n']; + fid=fopen(txt_lista_NA,'a+');%crear o abrir archivo lista.txt agregando al final de lista + %actualizando lista de archivos en directorio + fprintf(fid,Nuevo_Archivo{nuevo_a,1}); + fclose(fid); + %cerrar ListaArchivo + end + %Si existen archivos dentro el directorio, quedan + %listados desde la primera linea hasta la linea 'm' de + %lista_archivos, leer desde 1 a m-2. +%PARA ARCHIVOS DENTRO DE DIRECTORIO PADRE + elseif n_linea_dir(1)>1 && nuevo_a 1 + error(message('MATLAB:ls:TooManyOutputArguments')); +end + +% perform platform specific directory listing +if isunix + if nargin == 0 + [s,listing] = unix('ls'); + else + [s,listing] = unix(['ls',' ',varargin]); + end + + if s~=0 + error(message('MATLAB:ls:OSError',listing)); + end +else + if nargin == 0 + %hack to display output of dir in wide format. dir; prints out + %info. d=dir does not! + if nargout == 0 + dir; + else + d = dir; + listing = char(d.name); + end + elseif nargin == 1 + if nargout == 0 + dir(varargin{1}); + else + d = dir(varargin{1}); + listing = char(d.name); + end + else + error(message('MATLAB:ls:TooManyInputArguments')); + end +end + +% determine output mode, depending on presence of output arguments +if nargout == 0 && isunix + disp(listing) +elseif nargout > 0 + varargout{1} = listing; +end + +%--------------------------------------------------------------------------- +function quotedArgs = quoteUnixCmdArg(varargin) +% Algorithm: Start and end each argument with a single quote (squote). +% Within each argument: +% 1. squote -> squote '\' squote squote +% 2. '!' -> squote '\' '!' squote +% 3. '*' -> squote '*' squote (MATLAB globbing character) +% + +% Do any tilde expansion first +tildeArgs = varargin; +ix = find(strncmp(tildeArgs,'~',1)); +if ~isempty(ix) + tildeArgs(ix) = unix_tilde_expansion(tildeArgs(ix)); +end + +% Special cases to maintain as literal: single quote or ! with '\thing_I_found' +quotedArgs= regexprep(tildeArgs,'[''!]','''\\$&'''); + +% Special cases to maintain as NOT literal: Replace * with 'thing_I_found' +quotedArgs= regexprep(quotedArgs,'[*]','''$&'''); + +quotedArgs = strcat(' ''', quotedArgs, ''''); +quotedArgs = [quotedArgs{:}]; diff --git a/pathdef.m b/pathdef.m new file mode 100644 index 0000000..31860db --- /dev/null +++ b/pathdef.m @@ -0,0 +1,671 @@ +function p = pathdef +%PATHDEF Search path defaults. +% PATHDEF returns a string that can be used as input to MATLABPATH +% in order to set the path. + + +% Copyright 1984-2007 The MathWorks, Inc. +% $Revision: 1.4.2.2 $ $Date: 2007/06/07 14:45:14 $ + + +% DO NOT MODIFY THIS FILE. IT IS AN AUTOGENERATED FILE. +% EDITING MAY CAUSE THE FILE TO BECOME UNREADABLE TO +% THE PATHTOOL AND THE INSTALLER. + +p = [... +%%% BEGIN ENTRIES %%% + '/home/david/Documents/Proyectos_CEA/CNM008/Codigo_Mat:', ... + matlabroot,'/toolbox/local:', ... + matlabroot,'/toolbox/matlab/demos:', ... + matlabroot,'/toolbox/matlab/graph2d:', ... + matlabroot,'/toolbox/matlab/graph3d:', ... + matlabroot,'/toolbox/matlab/graphics:', ... + matlabroot,'/toolbox/matlab/plottools:', ... + matlabroot,'/toolbox/matlab/scribe:', ... + matlabroot,'/toolbox/matlab/specgraph:', ... + matlabroot,'/toolbox/matlab/uitools:', ... + matlabroot,'/toolbox/matlab/codetools:', ... + matlabroot,'/toolbox/matlab/datafun:', ... + matlabroot,'/toolbox/matlab/datamanager:', ... + matlabroot,'/toolbox/matlab/datatypes:', ... + matlabroot,'/toolbox/matlab/elfun:', ... + matlabroot,'/toolbox/matlab/elmat:', ... + matlabroot,'/toolbox/matlab/funfun:', ... + matlabroot,'/toolbox/matlab/general:', ... + matlabroot,'/toolbox/matlab/guide:', ... + matlabroot,'/toolbox/matlab/helptools:', ... + matlabroot,'/toolbox/matlab/iofun:', ... + matlabroot,'/toolbox/matlab/lang:', ... + matlabroot,'/toolbox/matlab/matfun:', ... + matlabroot,'/toolbox/matlab/ops:', ... + matlabroot,'/toolbox/matlab/polyfun:', ... + matlabroot,'/toolbox/matlab/randfun:', ... + matlabroot,'/toolbox/matlab/sparfun:', ... + matlabroot,'/toolbox/matlab/specfun:', ... + matlabroot,'/toolbox/matlab/strfun:', ... + matlabroot,'/toolbox/matlab/timefun:', ... + matlabroot,'/toolbox/matlab/verctrl:', ... + matlabroot,'/toolbox/matlab/optimfun:', ... + matlabroot,'/toolbox/hdlcoder/matlabhdlcoder/matlabhdlcoder:', ... + matlabroot,'/toolbox/hdlcoder/matlabhdlcoder:', ... + matlabroot,'/toolbox/matlab/testframework:', ... + matlabroot,'/toolbox/shared/glue:', ... + matlabroot,'/toolbox/shared/glue/studio:', ... + matlabroot,'/toolbox/simulink/simulink/frameedit:', ... + matlabroot,'/toolbox/simulink/simulink/modeladvisor:', ... + matlabroot,'/toolbox/simulink/simulink/modeladvisor/fixpt:', ... + matlabroot,'/toolbox/simulink/simdemos/simfeatures:', ... + matlabroot,'/toolbox/simulink/simdemos/automotive/fuelsys:', ... + matlabroot,'/toolbox/simulink/blocks/library:', ... + matlabroot,'/toolbox/simulink/blocks/obsolete:', ... + matlabroot,'/toolbox/simulink/simdemos/automotive:', ... + matlabroot,'/toolbox/simulink/simdemos/aerospace:', ... + matlabroot,'/toolbox/rtw/targets/AUTOSAR/AUTOSAR/dataclasses:', ... + matlabroot,'/toolbox/rtw/targets/AUTOSAR/AUTOSAR:', ... + matlabroot,'/toolbox/rtw/accel:', ... + matlabroot,'/toolbox/coder/simulinkcoder_core:', ... + matlabroot,'/toolbox/simulink/components:', ... + matlabroot,'/toolbox/simulink/dee:', ... + matlabroot,'/toolbox/simulink/blocks:', ... + matlabroot,'/toolbox/simulink/fixedandfloat:', ... + matlabroot,'/toolbox/simulink/fixedandfloat/obsolete:', ... + matlabroot,'/toolbox/simulink/simulink/dataclasses:', ... + matlabroot,'/toolbox/simulink/simulink:', ... + matlabroot,'/toolbox/simulink/simulink/MPlayIO:', ... + matlabroot,'/toolbox/simulink/simulink/dataobjectwizard:', ... + matlabroot,'/toolbox/simulink/simulink/slresolve:', ... + matlabroot,'/toolbox/simulink/simdemos/simgeneral:', ... + matlabroot,'/toolbox/simulink/simdemos/industrial:', ... + matlabroot,'/toolbox/simulink/simdemos/dataclasses:', ... + matlabroot,'/toolbox/simulink/simdemos:', ... + matlabroot,'/toolbox/stateflow/stateflow:', ... + matlabroot,'/toolbox/stateflow/coder:', ... + matlabroot,'/toolbox/stateflow/sfdemos:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/windows/blks:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/windows/blks/masks:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/windows/blks/mex:', ... + matlabroot,'/toolbox/physmod/sm/sm/m:', ... + matlabroot,'/help/toolbox/vision/examples:', ... + matlabroot,'/toolbox/physmod/sh/sh:', ... + matlabroot,'/toolbox/shared/optimlib:', ... + matlabroot,'/toolbox/slcontrol/slcontrol:', ... + matlabroot,'/toolbox/slcontrol/slctrlguis:', ... + matlabroot,'/toolbox/slcontrol/slctrlutil:', ... + matlabroot,'/toolbox/slcontrol/slctrlobsolete:', ... + matlabroot,'/toolbox/aeroblks/aeroblks:', ... + matlabroot,'/toolbox/aeroblks/aeroblksutilities:', ... + matlabroot,'/toolbox/shared/hdlshared:', ... + matlabroot,'/toolbox/shared/comparisons:', ... + matlabroot,'/toolbox/matlab/timeseries:', ... + matlabroot,'/toolbox/matlab/hds:', ... + matlabroot,'/toolbox/physmod/simscape/library/m:', ... + matlabroot,'/toolbox/edalink/extensions/incisive/incisivedemos:', ... + matlabroot,'/toolbox/physmod/simscape/compiler/core/m:', ... + matlabroot,'/toolbox/datafeed/datafeed:', ... + matlabroot,'/toolbox/datafeed/dfgui:', ... + matlabroot,'/toolbox/simulink/simulink/slproject:', ... + matlabroot,'/toolbox/shared/testmeaslib/general:', ... + matlabroot,'/toolbox/simrf/simrf:', ... + matlabroot,'/toolbox/simrf/simrfV2:', ... + matlabroot,'/toolbox/simrf/simrfV2masks:', ... + matlabroot,'/help/toolbox/simrf/examples:', ... + matlabroot,'/toolbox/comm/commdemos:', ... + matlabroot,'/toolbox/simulink/simulink/iodata/ioedit:', ... + matlabroot,'/toolbox/simulink/simulink/iodata/ioedit/util:', ... + matlabroot,'/toolbox/shared/configset:', ... + matlabroot,'/toolbox/dsp/filterdesign:', ... + matlabroot,'/toolbox/mpc/mpc:', ... + matlabroot,'/toolbox/mpc/mpcdemos:', ... + matlabroot,'/toolbox/mpc/mpcguis:', ... + matlabroot,'/toolbox/mpc/mpcobsolete:', ... + matlabroot,'/toolbox/mpc/mpcutils:', ... + matlabroot,'/toolbox/physmod/simscape/engine/core/m:', ... + matlabroot,'/toolbox/shared/can:', ... + matlabroot,'/toolbox/shared/can/canblks:', ... + matlabroot,'/toolbox/shared/can/canmasks:', ... + matlabroot,'/toolbox/shared/can/canmex:', ... + matlabroot,'/toolbox/shared/sldv:', ... + matlabroot,'/toolbox/physmod/simscape/compiler/mli/m:', ... + matlabroot,'/toolbox/fixedpoint/fixedpointtool:', ... + matlabroot,'/toolbox/ident/ident:', ... + matlabroot,'/toolbox/ident/nlident:', ... + matlabroot,'/toolbox/ident/idobsolete:', ... + matlabroot,'/toolbox/ident/idguis:', ... + matlabroot,'/toolbox/ident/idutils:', ... + matlabroot,'/toolbox/ident/idhelp:', ... + matlabroot,'/toolbox/physmod/simscape/engine/mli/m:', ... + matlabroot,'/toolbox/shared/simulink:', ... + matlabroot,'/toolbox/physmod/equation_language/equation_language:', ... + matlabroot,'/toolbox/coder/coverage:', ... + matlabroot,'/toolbox/shared/dsp/vision/matlab/utilities:', ... + matlabroot,'/toolbox/shared/dsp/vision/simulink/utilities:', ... + matlabroot,'/toolbox/shared/dsp/vision/matlab/utilities/mex:', ... + matlabroot,'/toolbox/shared/dsp/vision/simulink/utilities/mex:', ... + matlabroot,'/toolbox/shared/dsp/vision/matlab/utilities/init:', ... + matlabroot,'/toolbox/shared/dsp/vision/matlab/vision:', ... + matlabroot,'/toolbox/shared/dsp/vision/simulink/vision:', ... + matlabroot,'/toolbox/instrument/instrument:', ... + matlabroot,'/toolbox/instrument/instrumentblks/instrumentblks:', ... + matlabroot,'/toolbox/instrument/instrumentblks/instrumentmex:', ... + matlabroot,'/toolbox/instrument/instrumentblks/instrumentmasks:', ... + matlabroot,'/toolbox/aero/astdemos:', ... + matlabroot,'/toolbox/shared/testconsole:', ... + matlabroot,'/toolbox/physmod/sh/shdemos:', ... + matlabroot,'/toolbox/control/control:', ... + matlabroot,'/toolbox/control/ctrlguis:', ... + matlabroot,'/toolbox/control/ctrlobsolete:', ... + matlabroot,'/toolbox/control/ctrlutil:', ... + matlabroot,'/toolbox/physmod/simscape/simscapedemos:', ... + matlabroot,'/toolbox/finance/findemos:', ... + matlabroot,'/toolbox/hdlcoder/hdlcoder:', ... + matlabroot,'/toolbox/hdlcoder/hdlcoder/hdlwa:', ... + matlabroot,'/toolbox/sldv/sldvdemos:', ... + matlabroot,'/toolbox/rtw/targets/asap2/asap2/dataclasses:', ... + matlabroot,'/toolbox/rtw/targets/asap2/asap2:', ... + matlabroot,'/toolbox/rtw/targets/asap2/asap2/user:', ... + matlabroot,'/toolbox/rtw/targets/common/can/blocks/dataclasses:', ... + matlabroot,'/toolbox/rtw/targets/common/can/blocks:', ... + matlabroot,'/toolbox/rtw/targets/common/can/blocks/tlc_c:', ... + matlabroot,'/toolbox/rtw/targets/common/tgtcommon:', ... + matlabroot,'/toolbox/rtw/targets/connectivity:', ... + matlabroot,'/toolbox/rtw/targets/pil:', ... + matlabroot,'/toolbox/rtw/rtw/cgv/API:', ... + matlabroot,'/toolbox/rtw/rtw/misra:', ... + matlabroot,'/toolbox/simulinkcoder:', ... + matlabroot,'/toolbox/edalink/extensions/modelsim/modelsim:', ... + matlabroot,'/toolbox/signal/signal:', ... + matlabroot,'/toolbox/signal/sigtools:', ... + matlabroot,'/toolbox/signal/sptoolgui:', ... + matlabroot,'/help/toolbox/control/examples:', ... + matlabroot,'/toolbox/matlab/audiovideo:', ... + matlabroot,'/toolbox/physmod/simscape/simscape/m:', ... + matlabroot,'/toolbox/physmod/pm_sli/pm_sli:', ... + matlabroot,'/toolbox/aeroblks/aerodemos:', ... + matlabroot,'/toolbox/aeroblks/aerodemos/texture:', ... + matlabroot,'/toolbox/shared/system/fixedpoint:', ... + matlabroot,'/toolbox/fixedpoint/fixedpoint:', ... + matlabroot,'/toolbox/imaq/imaq:', ... + matlabroot,'/toolbox/imaq/imaqblks/imaqblks:', ... + matlabroot,'/toolbox/imaq/imaqblks/imaqmasks:', ... + matlabroot,'/toolbox/imaq/imaqblks/imaqmex:', ... + matlabroot,'/toolbox/physmod/simscape/compiler/sli/m:', ... + matlabroot,'/toolbox/shared/dspblks/dspblks:', ... + matlabroot,'/toolbox/shared/dspblks/dspmex:', ... + matlabroot,'/toolbox/database/dbdemos:', ... + matlabroot,'/toolbox/shared/controllib/requirements:', ... + matlabroot,'/toolbox/bioinfo/biodemos:', ... + matlabroot,'/toolbox/systemtest/systemtest:', ... + matlabroot,'/toolbox/systemtest/systemtest/removed:', ... + matlabroot,'/toolbox/shared/eda/edagraph:', ... + matlabroot,'/toolbox/simulink/fixedandfloat/fxpdemos:', ... + matlabroot,'/toolbox/shared/maputils:', ... + matlabroot,'/toolbox/physmod/sm/sli/m:', ... + matlabroot,'/toolbox/shared/multimedia:', ... + matlabroot,'/toolbox/shared/system/coder:', ... + matlabroot,'/toolbox/fixedpoint/fidemos:', ... + matlabroot,'/toolbox/physmod/powersys/powersys:', ... + matlabroot,'/toolbox/physmod/powersys/DR/DR:', ... + matlabroot,'/toolbox/physmod/powersys/drives/drives:', ... + matlabroot,'/toolbox/physmod/powersys/facts/facts:', ... + matlabroot,'/toolbox/shared/eda/fpgabase:', ... + matlabroot,'/toolbox/shared/advisor:', ... + matlabroot,'/toolbox/javabuilder/javabuilderdemos:', ... + matlabroot,'/toolbox/shared/statslib:', ... + matlabroot,'/toolbox/shared/instrument:', ... + matlabroot,'/help/toolbox/robust/examples:', ... + matlabroot,'/toolbox/shared/eda/fpgaautomation:', ... + matlabroot,'/toolbox/shared/eda/fpgaautomation/obsolete:', ... + matlabroot,'/toolbox/fixpoint:', ... + matlabroot,'/toolbox/fixpoint/fpca:', ... + matlabroot,'/toolbox/shared/system/simulink:', ... + matlabroot,'/toolbox/shared/slcontrollib:', ... + matlabroot,'/toolbox/rtw/targets/ecoder/ecoderdemos/dataclasses:', ... + matlabroot,'/toolbox/rtw/targets/ecoder/ecoderdemos:', ... + matlabroot,'/toolbox/coder/emlcodermex:', ... + matlabroot,'/toolbox/target/targetdemos:', ... + matlabroot,'/toolbox/physmod/common/gl/sli/m:', ... + matlabroot,'/toolbox/fuzzy/fuzzy:', ... + matlabroot,'/toolbox/fuzzy/fuzzyutil:', ... + matlabroot,'/toolbox/shared/controllib/engine:', ... + matlabroot,'/toolbox/shared/controllib/engine/numerics:', ... + matlabroot,'/toolbox/shared/controllib/engine/options:', ... + matlabroot,'/toolbox/shared/controllib/engine/optim:', ... + matlabroot,'/toolbox/optim/optimdemos:', ... + matlabroot,'/toolbox/eml/eml:', ... + matlabroot,'/toolbox/distcomp:', ... + matlabroot,'/toolbox/distcomp/distcomp:', ... + matlabroot,'/toolbox/distcomp/user:', ... + matlabroot,'/toolbox/distcomp/mpi:', ... + matlabroot,'/toolbox/distcomp/parallel:', ... + matlabroot,'/toolbox/distcomp/parallel/util:', ... + matlabroot,'/toolbox/distcomp/lang:', ... + matlabroot,'/toolbox/distcomp/cluster:', ... + matlabroot,'/toolbox/distcomp/gpu:', ... + matlabroot,'/toolbox/distcomp/array:', ... + matlabroot,'/toolbox/idelink:', ... + matlabroot,'/toolbox/idelink/foundation:', ... + matlabroot,'/toolbox/idelink/foundation/util:', ... + matlabroot,'/toolbox/idelink/foundation/errorhandler:', ... + matlabroot,'/toolbox/idelink/foundation/xmakefile:', ... + matlabroot,'/toolbox/idelink/foundation/hookpoints:', ... + matlabroot,'/toolbox/rf/rf:', ... + matlabroot,'/toolbox/rf/rfnetparamfiles:', ... + matlabroot,'/toolbox/rf/rftool:', ... + matlabroot,'/toolbox/shared/dastudio:', ... + matlabroot,'/toolbox/shared/dastudio/depviewer:', ... + matlabroot,'/toolbox/distcomp/worker:', ... + matlabroot,'/toolbox/slci/slcidemos:', ... + matlabroot,'/toolbox/edalink/foundation/hdllink:', ... + matlabroot,'/toolbox/curvefit/curvefit:', ... + matlabroot,'/toolbox/curvefit/splines:', ... + matlabroot,'/toolbox/curvefit/cftoolgui:', ... + matlabroot,'/toolbox/curvefit/sftoolgui:', ... + matlabroot,'/toolbox/rptgen/rptgen:', ... + matlabroot,'/toolbox/hdlcoder/hdlcommon:', ... + matlabroot,'/toolbox/shared/rptgen:', ... + matlabroot,'/toolbox/shared/m3i:', ... + matlabroot,'/toolbox/rptgen/xmlcomp/demos:', ... + matlabroot,'/toolbox/slci/slci:', ... + matlabroot,'/toolbox/physmod/drive/drivedemos:', ... + matlabroot,'/toolbox/idelink/idelinkdemos:', ... + matlabroot,'/toolbox/idelink/extensions/eclipseide/eclipseidedemos:', ... + matlabroot,'/toolbox/idelink/extensions/iarew/iarewdemos:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/ccsdemos:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/ccsdemos/util:', ... + matlabroot,'/toolbox/target:', ... + matlabroot,'/toolbox/target/foundation:', ... + matlabroot,'/toolbox/target/foundation/utils:', ... + matlabroot,'/toolbox/target/foundation/utils/resource_config:', ... + matlabroot,'/toolbox/target/foundation/blks:', ... + matlabroot,'/toolbox/target/foundation/blks/mex:', ... + matlabroot,'/toolbox/target/foundation/blks/masks:', ... + matlabroot,'/toolbox/target/extensions/processor/shared:', ... + matlabroot,'/toolbox/target/extensions/processor/shared/ti:', ... + matlabroot,'/toolbox/target/extensions/processor/shared/ti/mdlinfo:', ... + matlabroot,'/toolbox/target/extensions/processor/shared/ti/utils:', ... + matlabroot,'/toolbox/target/extensions/processor/shared/ti/blks:', ... + matlabroot,'/toolbox/target/extensions/processor/shared/ti/blks/mex:', ... + matlabroot,'/toolbox/target/extensions/processor/shared/ti/blks/masks:', ... + matlabroot,'/toolbox/shared/etargets/etargets:', ... + matlabroot,'/toolbox/shared/etargets/etargets/demoutils:', ... + matlabroot,'/toolbox/sldv/sldv:', ... + matlabroot,'/toolbox/shared/system/sfun:', ... + matlabroot,'/toolbox/signal/sigdemos:', ... + matlabroot,'/toolbox/shared/hdlshared/hdlshared_gui:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/linux/blks:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/linux/blks/masks:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/linux/blks/mex:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/linux/src:', ... + matlabroot,'/toolbox/physmod/sm/import/m:', ... + matlabroot,'/toolbox/physmod/simscape/foundation/simscape:', ... + matlabroot,'/toolbox/matlab/connector/connector:', ... + matlabroot,'/toolbox/shared/measure:', ... + matlabroot,'/toolbox/coder/codegendemos:', ... + matlabroot,'/toolbox/shared/dsp/hdl:', ... + matlabroot,'/toolbox/edalink/edalink:', ... + matlabroot,'/toolbox/hdlverifier/hdlverifier:', ... + matlabroot,'/toolbox/edalink/extensions/discovery/discovery:', ... + matlabroot,'/toolbox/shared/tlmgenerator/foundation:', ... + matlabroot,'/toolbox/shared/tlmgenerator/foundation/rtw:', ... + matlabroot,'/toolbox/shared/tlmgenerator/foundation/tlmgeneratordemos:', ... + matlabroot,'/toolbox/systemtest/systemtestdemos:', ... + matlabroot,'/toolbox/physmod/network_engine/ne_support:', ... + matlabroot,'/toolbox/physmod/network_engine/network_engine:', ... + matlabroot,'/toolbox/coder/profile:', ... + matlabroot,'/toolbox/shared/mapgeodesy:', ... + matlabroot,'/toolbox/aero/aero:', ... + matlabroot,'/toolbox/comm/comm:', ... + matlabroot,'/toolbox/comm/commutilities/comminit:', ... + matlabroot,'/toolbox/comm/commutilities/commmex:', ... + matlabroot,'/toolbox/comm/commutilities:', ... + matlabroot,'/toolbox/comm/commdeprecated:', ... + matlabroot,'/toolbox/shared/hwconnectinstaller/common:', ... + matlabroot,'/toolbox/rptgenext/rptgenext:', ... + matlabroot,'/toolbox/target/extensions/processor/tic2000:', ... + matlabroot,'/toolbox/target/extensions/processor/tic2000/rtw:', ... + matlabroot,'/toolbox/target/extensions/processor/tic2000/utils:', ... + matlabroot,'/toolbox/target/extensions/processor/tic2000/blks:', ... + matlabroot,'/toolbox/target/extensions/processor/tic2000/blks/mex:', ... + matlabroot,'/toolbox/target/extensions/processor/tic2000/blks/masks:', ... + matlabroot,'/toolbox/physmod/ne_sli/ne_sli:', ... + matlabroot,'/toolbox/hdlfilter/hdlfiltdemos:', ... + matlabroot,'/toolbox/images/imdemos:', ... + matlabroot,'/toolbox/physmod/common/gl/mli/m:', ... + matlabroot,'/toolbox/shared/siglib:', ... + matlabroot,'/toolbox/physmod/pm_visimpl/pm_visimpl:', ... + matlabroot,'/toolbox/physmod/common/units/mli/m:', ... + matlabroot,'/toolbox/physmod/sm/gui/m:', ... + matlabroot,'/toolbox/slvnv/reqmgt:', ... + matlabroot,'/toolbox/slvnv/reqmgt/RTExplorer:', ... + matlabroot,'/toolbox/slvnv/slvnv:', ... + matlabroot,'/toolbox/matlab/imagesci:', ... + matlabroot,'/toolbox/shared/system/coreblocks:', ... + matlabroot,'/toolbox/pde:', ... + matlabroot,'/toolbox/bioinfo/bioinfo:', ... + matlabroot,'/toolbox/bioinfo/biolearning:', ... + matlabroot,'/toolbox/bioinfo/microarray:', ... + matlabroot,'/toolbox/bioinfo/mass_spec:', ... + matlabroot,'/toolbox/bioinfo/proteins:', ... + matlabroot,'/toolbox/bioinfo/biomatrices:', ... + matlabroot,'/toolbox/bioinfo/graphtheory:', ... + matlabroot,'/toolbox/vision/vision:', ... + matlabroot,'/toolbox/vision/visionutilities:', ... + matlabroot,'/toolbox/vision/visionutilities/visioninit:', ... + matlabroot,'/toolbox/vision/visionutilities/visionmex:', ... + matlabroot,'/toolbox/optim/optim:', ... + matlabroot,'/toolbox/optim:', ... + matlabroot,'/toolbox/pde/pdedemos:', ... + matlabroot,'/toolbox/physmod/sdl/sdldemos:', ... + matlabroot,'/toolbox/dsp/dspdemos:', ... + matlabroot,'/toolbox/shared/cgir_fe:', ... + matlabroot,'/toolbox/coder/coder:', ... + matlabroot,'/toolbox/sldo/sldodemos:', ... + matlabroot,'/toolbox/sldo/sldodemos/optim:', ... + matlabroot,'/toolbox/sldo/sldodemos/estim:', ... + matlabroot,'/toolbox/sldo/sldodemos/estim/docexamples/adaptive:', ... + matlabroot,'/toolbox/sldo/sldodemos/estim/docexamples/lookuptable:', ... + matlabroot,'/toolbox/econ/econdemos:', ... + matlabroot,'/help/toolbox/dsp/examples:', ... + matlabroot,'/toolbox/rptgen/rptgendemos:', ... + matlabroot,'/toolbox/stats/stats:', ... + matlabroot,'/toolbox/stats/classreg:', ... + matlabroot,'/toolbox/stats/statsdemos:', ... + matlabroot,'/toolbox/rtw/rtw:', ... + matlabroot,'/toolbox/rtw/targets/shared:', ... + matlabroot,'/toolbox/coder/foundation:', ... + matlabroot,'/toolbox/coder/foundation/tfl:', ... + matlabroot,'/toolbox/coder/foundation/build:', ... + matlabroot,'/toolbox/coder/foundation/build/tools/registry:', ... + matlabroot,'/toolbox/shared/simtargets:', ... + matlabroot,'/toolbox/shared/testmeaslib/simulink:', ... + matlabroot,'/toolbox/realtime:', ... + matlabroot,'/toolbox/realtime/realtime:', ... + matlabroot,'/toolbox/realtime/realtime/rtw:', ... + matlabroot,'/toolbox/database/database:', ... + matlabroot,'/toolbox/database/vqb:', ... + matlabroot,'/toolbox/simulink/simulink/performance:', ... + matlabroot,'/toolbox/simulink/simulink/performance/performancea:', ... + matlabroot,'/toolbox/rptgen/xmlcomp:', ... + matlabroot,'/toolbox/map/map:', ... + matlabroot,'/toolbox/map/mapgeodesy:', ... + matlabroot,'/toolbox/map/mapdisp:', ... + matlabroot,'/toolbox/map/mapformats:', ... + matlabroot,'/toolbox/map/mapproj:', ... + matlabroot,'/toolbox/map/mapdata:', ... + matlabroot,'/toolbox/map/mapdata/sdts:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000/tic6000demos/dataclasses:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000/tic6000demos:', ... + matlabroot,'/toolbox/qualkits/common:', ... + matlabroot,'/toolbox/instrument/instrumentdemos:', ... + matlabroot,'/toolbox/physmod/sm/ssci/m:', ... + matlabroot,'/toolbox/shared/hwconnectinstaller:', ... + matlabroot,'/toolbox/physmod/common/dataservices/mli/m:', ... + matlabroot,'/toolbox/physmod/simrf/m:', ... + matlabroot,'/toolbox/slcontrol/slctrldemos:', ... + matlabroot,'/toolbox/wavelet/wavelet:', ... + matlabroot,'/toolbox/wavelet/wmultisig1d:', ... + matlabroot,'/toolbox/wavelet/wavedemo:', ... + matlabroot,'/toolbox/wavelet/compression:', ... + matlabroot,'/toolbox/physmod/common/dataservices/core/m:', ... + matlabroot,'/toolbox/rtw/targets/ecoder:', ... + matlabroot,'/toolbox/rtw/targets/mpt:', ... + matlabroot,'/toolbox/rtw/targets/mpt/mpt:', ... + matlabroot,'/toolbox/rtw/targets/mpt/user_specific:', ... + matlabroot,'/toolbox/embeddedcoder:', ... + matlabroot,'/toolbox/rptgenext/rptgenextdemos/slxmlcomp:', ... + matlabroot,'/toolbox/compiler:', ... + matlabroot,'/toolbox/des/desblks:', ... + matlabroot,'/toolbox/des/desmasks:', ... + matlabroot,'/toolbox/des/desmex:', ... + matlabroot,'/toolbox/globaloptim/globaloptimdemos:', ... + matlabroot,'/toolbox/physmod/sm/local/m:', ... + matlabroot,'/toolbox/simulink/blocks/sb2sl:', ... + matlabroot,'/toolbox/sl3d/sl3d:', ... + matlabroot,'/toolbox/phased/phased:', ... + matlabroot,'/toolbox/phased/phasedapps:', ... + matlabroot,'/toolbox/phased/phaseddemos:', ... + matlabroot,'/toolbox/qualkits/iec:', ... + matlabroot,'/toolbox/shared/sigbldr:', ... + matlabroot,'/toolbox/dsp/dsp:', ... + matlabroot,'/toolbox/dsp/dsputilities:', ... + matlabroot,'/toolbox/dsp/dsputilities/dspinit:', ... + matlabroot,'/toolbox/dsp/dsputilities/dspmex:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/vxworks/blks:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/vxworks/blks/mex:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/vxworks/blks/masks:', ... + matlabroot,'/toolbox/target/extensions/operatingsystem/vxworks/src:', ... + matlabroot,'/toolbox/physmod/simscape/engine/sli/m:', ... + matlabroot,'/toolbox/simrf/simrfV2demos:', ... + matlabroot,'/toolbox/physmod/sm/core/m:', ... + matlabroot,'/toolbox/rfblks/rfblks:', ... + matlabroot,'/toolbox/rfblks/rfblksmasks:', ... + matlabroot,'/toolbox/rfblks/rfblksmex:', ... + matlabroot,'/toolbox/physmod/sm/smdemos:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/wing_landing_gear:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/wing_landing_gear/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/cart_double_pendulum:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/cart_double_pendulum/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/stewart_platform:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/stewart_platform/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/double_crank_aiming:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/double_crank_aiming/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/bread_slicer:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/bread_slicer/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/import/stewart_platform:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/import/four_bar:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/radial_engine:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/radial_engine/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/double_wishbone_suspension:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/double_wishbone_suspension/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/import/robot:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/cardan_gear:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/cardan_gear/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/windshield_wiper:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/windshield_wiper/images:', ... + matlabroot,'/toolbox/physmod/sm/smdemos/backhoe:', ... + matlabroot,'/toolbox/qualkits/do:', ... + matlabroot,'/toolbox/shared/imaqlib:', ... + matlabroot,'/toolbox/shared/slvnv:', ... + matlabroot,'/toolbox/slvnv/simcoverage:', ... + matlabroot,'/toolbox/matlab/apps:', ... + matlabroot,'/toolbox/javabuilder/javabuilder:', ... + matlabroot,'/toolbox/simevents/examples:', ... + matlabroot,'/toolbox/shared/testmeaslib/graphics:', ... + matlabroot,'/toolbox/shared/imageslib:', ... + matlabroot,'/toolbox/econ/econ:', ... + matlabroot,'/toolbox/symbolic/symbolic:', ... + matlabroot,'/toolbox/symbolic/symbolicdemos:', ... + matlabroot,'/toolbox/target/extensions/processor/intelhost/tfl:', ... + matlabroot,'/toolbox/curvefit/curvefitdemos:', ... + matlabroot,'/toolbox/physmod/mech/mechdemos:', ... + matlabroot,'/toolbox/physmod/mech/mech:', ... + matlabroot,'/toolbox/physmod/mech/importer:', ... + matlabroot,'/toolbox/physmod/common/foundation/mli/m:', ... + matlabroot,'/toolbox/target/extensions/processor/tic5000/tic5000demos:', ... + matlabroot,'/toolbox/shared/controllib/general:', ... + matlabroot,'/toolbox/vision/visiondemos:', ... + matlabroot,'/toolbox/shared/eda/fil:', ... + matlabroot,'/toolbox/shared/eda/fil/filmapi:', ... + matlabroot,'/toolbox/rtw/rtwdemos:', ... + matlabroot,'/toolbox/rtw/rtwdemos/rsimdemos:', ... + matlabroot,'/toolbox/shared/eda/fil/fildemos:', ... + matlabroot,'/toolbox/shared/spcuilib:', ... + matlabroot,'/toolbox/fininst/fininstdemos:', ... + matlabroot,'/toolbox/map/mapdemos:', ... + matlabroot,'/toolbox/physmod/sdl/sdl:', ... + matlabroot,'/toolbox/physmod/sdl/classic:', ... + matlabroot,'/toolbox/hdlfilter/hdlfilter:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000/rtw:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000/tfl:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000/utils:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000/blks:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000/blks/mex:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000/blks/sysobj_mex:', ... + matlabroot,'/toolbox/target/extensions/processor/tic6000/blks/masks:', ... + matlabroot,'/toolbox/slvnv/styleguide:', ... + matlabroot,'/toolbox/shared/controllib/graphics:', ... + matlabroot,'/toolbox/shared/controllib/graphics/utils:', ... + matlabroot,'/toolbox/shared/controllib/graphics/plotoptions:', ... + matlabroot,'/toolbox/hdlcoder/hdlcoderdemos:', ... + matlabroot,'/toolbox/hdlcoder/hdlcoderdemos/matlabhdlcoderdemos:', ... + matlabroot,'/toolbox/shared/dsp/simulink/dsp:', ... + matlabroot,'/help/toolbox/slcontrol/examples:', ... + matlabroot,'/toolbox/geoweb/geoweb:', ... + matlabroot,'/toolbox/compiler/compilerdemos:', ... + matlabroot,'/toolbox/shared/eda/hdlparser:', ... + matlabroot,'/toolbox/coder/connectivity:', ... + matlabroot,'/toolbox/physmod/gui/gfx/m:', ... + matlabroot,'/toolbox/simevents/simevents:', ... + matlabroot,'/toolbox/simevents/simevents/icons:', ... + matlabroot,'/toolbox/sl3d/sl3ddemos:', ... + matlabroot,'/toolbox/edalink/extensions/incisive/incisive:', ... + matlabroot,'/toolbox/shared/curvefitlib:', ... + matlabroot,'/toolbox/finance/finance:', ... + matlabroot,'/toolbox/finance/calendar:', ... + matlabroot,'/toolbox/finance/finsupport:', ... + matlabroot,'/toolbox/finance/ftseries:', ... + matlabroot,'/help/toolbox/comm/examples:', ... + matlabroot,'/toolbox/shared/asynciolib:', ... + matlabroot,'/toolbox/coder/matlabcoder:', ... + matlabroot,'/toolbox/physmod/powersys/DR/DRdemo:', ... + matlabroot,'/toolbox/physmod/powersys/drives/drivesdemo:', ... + matlabroot,'/toolbox/physmod/powersys/facts/factsdemo:', ... + matlabroot,'/toolbox/physmod/powersys/powerdemo:', ... + matlabroot,'/toolbox/physmod/powersys/powerdemo/machines:', ... + matlabroot,'/toolbox/physmod/powersys/powerdemo/meascontrol:', ... + matlabroot,'/toolbox/physmod/powersys/powerdemo/power_electronics:', ... + matlabroot,'/toolbox/physmod/powersys/powerdemo/power_utility:', ... + matlabroot,'/toolbox/physmod/powersys/powerdemo/simple:', ... + matlabroot,'/toolbox/fininst/fininst:', ... + matlabroot,'/toolbox/fuzzy/fuzdemos:', ... + matlabroot,'/toolbox/stm/stm:', ... + matlabroot,'/toolbox/shared/cgxe/cgxe:', ... + matlabroot,'/toolbox/simulink/simulink/iodata/iomap:', ... + matlabroot,'/toolbox/simulink/simulink/upgradeadvisor:', ... + matlabroot,'/toolbox/physmod/drive/drive:', ... + matlabroot,'/toolbox/simbio/simbio:', ... + matlabroot,'/toolbox/physmod/elec/elecdemos:', ... + matlabroot,'/toolbox/rptgenext/slxmlcomp:', ... + matlabroot,'/toolbox/coder/float2fixed:', ... + matlabroot,'/toolbox/coder/float2fixed/dmm_emlauthoring:', ... + matlabroot,'/toolbox/imaq/imaqdemos:', ... + matlabroot,'/toolbox/edalink/extensions/modelsim/modelsimdemos:', ... + matlabroot,'/toolbox/slvnv/slvnvdemos:', ... + matlabroot,'/toolbox/slvnv/rmidemos:', ... + matlabroot,'/toolbox/slvnv/simcovdemos:', ... + matlabroot,'/toolbox/target/extensions/processor/tic2000/tic2000demos/dataclasses:', ... + matlabroot,'/toolbox/target/extensions/processor/tic2000/tic2000demos:', ... + matlabroot,'/toolbox/control/ctrldemos:', ... + matlabroot,'/toolbox/stm/stmdemos:', ... + matlabroot,'/toolbox/coder/rtiostream:', ... + matlabroot,'/toolbox/matlab/system:', ... + matlabroot,'/toolbox/idelink/extensions/eclipseide:', ... + matlabroot,'/toolbox/idelink/extensions/eclipseide/mdlinfo:', ... + matlabroot,'/toolbox/idelink/extensions/eclipseide/registry:', ... + matlabroot,'/toolbox/idelink/extensions/eclipseide/tfl:', ... + matlabroot,'/toolbox/idelink/extensions/iarew:', ... + matlabroot,'/toolbox/idelink/extensions/iarew/blks:', ... + matlabroot,'/toolbox/idelink/extensions/iarew/mdlinfo:', ... + matlabroot,'/toolbox/idelink/extensions/iarew/templates:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/ccsblks:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/ccslinkblks:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/ccslinkblks/rtdxsimblks:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/lic:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/mdlinfo:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/tfl:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/util:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/rtw:', ... + matlabroot,'/toolbox/idelink/extensions/ticcs/envChecker:', ... + matlabroot,'/toolbox/idelink/extensions/wrworkbench:', ... + matlabroot,'/toolbox/idelink/extensions/wrworkbench/mdlinfo:', ... + matlabroot,'/toolbox/idelink/extensions/wrworkbench/registry:', ... + matlabroot,'/toolbox/idelink/extensions/wrworkbench/wrworkbenchblks:', ... + matlabroot,'/toolbox/idelink/foundation/pjtgenerator:', ... + matlabroot,'/toolbox/idelink/foundation/pjtgenerator/rtw:', ... + matlabroot,'/toolbox/idelink/foundation/pjtgenerator/tgtpref2:', ... + matlabroot,'/toolbox/idelink/foundation/pjtgenerator/profiler:', ... + matlabroot,'/toolbox/idelink/foundation/pjtgenerator/mdlinfo:', ... + matlabroot,'/toolbox/idelink/foundation/pjtgenerator/blks:', ... + matlabroot,'/toolbox/idelink/foundation/pjtgenerator/blks/masks:', ... + matlabroot,'/toolbox/idelink/foundation/pjtgenerator/blks/tlc_c:', ... + matlabroot,'/toolbox/nnet:', ... + matlabroot,'/toolbox/nnet/nncontrol:', ... + matlabroot,'/toolbox/nnet/nndemos:', ... + matlabroot,'/toolbox/nnet/nndemos/nndatasets:', ... + matlabroot,'/toolbox/nnet/nnet:', ... + matlabroot,'/toolbox/nnet/nnet/nnadapt:', ... + matlabroot,'/toolbox/nnet/nnet/nndatafun:', ... + matlabroot,'/toolbox/nnet/nnet/nnderivative:', ... + matlabroot,'/toolbox/nnet/nnet/nndistance:', ... + matlabroot,'/toolbox/nnet/nnet/nndivision:', ... + matlabroot,'/toolbox/nnet/nnet/nninitlayer:', ... + matlabroot,'/toolbox/nnet/nnet/nninitnetwork:', ... + matlabroot,'/toolbox/nnet/nnet/nninitweight:', ... + matlabroot,'/toolbox/nnet/nnet/nnlearn:', ... + matlabroot,'/toolbox/nnet/nnet/nnnetfun:', ... + matlabroot,'/toolbox/nnet/nnet/nnnetinput:', ... + matlabroot,'/toolbox/nnet/nnet/nnnetwork:', ... + matlabroot,'/toolbox/nnet/nnet/nnperformance:', ... + matlabroot,'/toolbox/nnet/nnet/nnplot:', ... + matlabroot,'/toolbox/nnet/nnet/nnprocess:', ... + matlabroot,'/toolbox/nnet/nnet/nnsearch:', ... + matlabroot,'/toolbox/nnet/nnet/nntopology:', ... + matlabroot,'/toolbox/nnet/nnet/nntrain:', ... + matlabroot,'/toolbox/nnet/nnet/nntransfer:', ... + matlabroot,'/toolbox/nnet/nnet/nnweight:', ... + matlabroot,'/toolbox/nnet/nnguis:', ... + matlabroot,'/toolbox/nnet/nnobsolete:', ... + matlabroot,'/toolbox/nnet/nnutils:', ... + matlabroot,'/toolbox/rptgenext/rptgenextdemos:', ... + matlabroot,'/toolbox/rptgenext/rptgenextdemos/flutter_suppression:', ... + matlabroot,'/toolbox/rptgenext/rptgenextdemos/sdd:', ... + matlabroot,'/toolbox/globaloptim:', ... + matlabroot,'/toolbox/globaloptim/globaloptim:', ... + matlabroot,'/toolbox/shared/eda/board:', ... + matlabroot,'/toolbox/rf/rfdemos:', ... + matlabroot,'/toolbox/ident/iddemos:', ... + matlabroot,'/toolbox/ident/iddemos/examples:', ... + matlabroot,'/toolbox/images/colorspaces:', ... + matlabroot,'/toolbox/images/images:', ... + matlabroot,'/toolbox/images/imuitools:', ... + matlabroot,'/toolbox/images/iptformats:', ... + matlabroot,'/toolbox/images/iptutils:', ... + matlabroot,'/toolbox/slvnv/iec61508:', ... + matlabroot,'/toolbox/slvnv/do178b:', ... + matlabroot,'/toolbox/robust/robust:', ... + matlabroot,'/toolbox/robust/rctlmi:', ... + matlabroot,'/toolbox/robust/rctutil:', ... + matlabroot,'/toolbox/robust/rctdemos:', ... + matlabroot,'/toolbox/robust/rctobsolete/robust:', ... + matlabroot,'/toolbox/robust/rctobsolete/lmi:', ... + matlabroot,'/toolbox/robust/rctobsolete/mutools/commands:', ... + matlabroot,'/toolbox/robust/rctobsolete/mutools/subs:', ... + matlabroot,'/toolbox/simbio/simbiodemos:', ... + matlabroot,'/toolbox/rfblks/rfblksdemos:', ... + matlabroot,'/help/toolbox/sldo/examples:', ... + matlabroot,'/toolbox/physmod/elec/elec:', ... + matlabroot,'/toolbox/distcomp/pctdemos:', ... + matlabroot,'/toolbox/shared/coder/coder:', ... + matlabroot,'/toolbox/physmod/common/data/mli/m:', ... + matlabroot,'/toolbox/sldo/sldo:', ... + matlabroot,'/toolbox/sldo/sldoguis:', ... + matlabroot,'/toolbox/sldo/sloptim/sloptim:', ... + matlabroot,'/toolbox/sldo/sloptim/sloptguis:', ... + matlabroot,'/toolbox/sldo/sloptim/sloptobsolete:', ... + matlabroot,'/toolbox/sldo/slestim/slestguis:', ... + matlabroot,'/toolbox/sldo/slestim/slestim:', ... + matlabroot,'/toolbox/sldo/slestim/slestmex:', ... + matlabroot,'/toolbox/sldo/slestim/slestutil:', ... + matlabroot,'/toolbox/target/extensions/processor/tic5000:', ... + matlabroot,'/toolbox/target/extensions/processor/tic5000/blks:', ... + matlabroot,'/toolbox/target/extensions/processor/tic5000/blks/mex:', ... + matlabroot,'/toolbox/target/extensions/processor/tic5000/blks/masks:', ... + matlabroot,'/toolbox/shared/filterdesignlib:', ... +%%% END ENTRIES %%% + ... +]; + +p = [userpath,p]; diff --git a/reflactancia.m b/reflactancia.m new file mode 100644 index 0000000..e5385b1 --- /dev/null +++ b/reflactancia.m @@ -0,0 +1,142 @@ +%calcula la reflactancia R_l +%calcula la radianca L_l +%Calcula o entrega los datos en DN7 +%Entrega projeccion utm utilizada +%Entregar numero de banda +%entregar id Landsat {1,2,3,4,5,7} +%entregar Path +%Entregar hemisferio + +function [R_l,L_l,DN7,UTM,COD_SAT_IMG,R]=reflactancia(Banda,Landsat,Path,Hemisferio,Nombre_Proceso) +%crear carpeta de proceso en Log +[status_1,message_1,messageid_1] = mkdir('Logs',Nombre_Proceso); +%crear carpeta de proceso en Output +[status_2,message_2,messageid_2] = mkdir('Output',Nombre_Proceso); +%valores slope para conversion DN5 a NDN7 +%Hemisferio Sur +%Bajo la formula DN7=(slope*DN5)+intercep +%Landsat=[1 a 7]; +%datos de correccion landsat +%Nombres bandas:[blue,green,red,NIR,SWIR,-] +Slope=[0.943,1.776,1.538,1.427,0.984,0,1.304]; +Intercep=[4.21,2.58,2.5,4.8,6.96,0,5.76]; +%valores gain y bias para convertir a datos radiacion +%bajo formula L_l=(gain*DN7)+bias +Gain_radiance=[0.778740,0.798819,0.621654,0.639764,0.12622,0,0.043898]; +Bias_radiance=[-6.98,-7.2,-5.62,-5.74,-1.13,0,-.39]; +%conversión de datos radiacion a reflectancia. +%se cargan los datos de distancia tierra sol +%el nombre de la variables sera: d=Dist_tierra_sol +%R_l= (%pi L d^2) / (Esun sin(Omega_se)) +d=load('Dist_tierra_sol.m'); %cada dia un valor, en astronomical units +%Densidad Energia solar Esun[Watt/(m^2 %um)] +Esun_l=[1997,1812,1533,1039,2260.8,0,84.9]; +%cargar la elevación solar _MTL.txt +%buscar por angulo elevacion solar 'SUN_ELEVATION' entregar valor a la derecha de '=' +%buscar dia y hora por 'DATE_HOUR_CONTACT_PERIOD' +%se entrega en degrees y fecha YY-DDD-HH DDD el dia del año +Carpeta_img=Path; +%listar archivos txt +archivo_MTL=get_list_files(Carpeta_img,'*_MTL.txt'); +archivoMTL=char(archivo_MTL); +N_MTL=length(archivoMTL); +COD_SAT_IMG=archivoMTL(1:N_MTL-8); +FilePath=char(strcat(Carpeta_img,'/',archivo_MTL)); +%buscar 'SUN_ELEVATION' +%buscar 'DATE_HOUR_CONTACT_PERIOD' +if Landsat==7 +%Para DN7 +Nombres_Valores={'SUN_ELEVATION','DATE_HOUR_CONTACT_PERIOD'}; +elseif Landsat==5 +%Para DN5 +Nombres_Valores={'SUN_ELEVATION','LANDSAT_SCENE_ID'}; +end +[Valores,Nombres_Obtenidos,N_lin]=buscar_valor_archivo(Nombres_Valores, FilePath); +%N_lin es largo de cada linea extraida del archivo. +%fclose(FID); +%verificar que se encontraron todos los valores buscados +L1=length(Nombres_Valores); +L2=length(Nombres_Obtenidos); +min_l1l2=min([L1,L2]); +Log_MTL=['Logs/',Nombre_Proceso,'/log_mtl.txt']; +fid_mtl = fopen(Log_MTL,'a+'); +Hora=fix(clock); +String_hora=[num2str(Hora(1)),'/',num2str(Hora(2)),'/',num2str(Hora(3)),' a las ',num2str(Hora(4)),':',num2str(Hora(5)),' hrs']; +if ~eq(L1,L2) + fprintf (fid_mtl,strcat(String_hora,'. No se encuentra valor en @',char(FilePath),'\r\n'),'a+'); +else + fprintf (fid_mtl,strcat(String_hora,'. Todos los valores encontradoes en @',char(FilePath),'\r\n'),'a+'); +end +fclose(fid_mtl); +%SUN ELEVATION +%Valores a numeros (deg --> rad) +%buscamos la posicion de Nombres_Valores que corresponde a SUN ELEVATION +Nombre_SE=Nombres_Valores(1); +indice=buscarindice(Nombre_SE,Nombres_Obtenidos); +SUN_elevation_deg=str2double(char(Valores(indice))); +SUN_elevation_rad=SUN_elevation_deg*pi/180; +%se consigue el día de la toma a partir del MTL +%si es LT5 +Nombre_Sc=Nombres_Valores(2); +indice=buscarindice(Nombre_Sc,Nombres_Obtenidos); +Scene=char(Valores(indice)); +Ls=length(Scene); +dia=str2double(Scene(Ls-8:Ls-6)); +distancia_ts=d(dia);% en unidadddes astronomicas +%se carga la imagen de banda4. +%buscar la que termina con _B4.txt +Busqueda=strcat('*_B',num2str(Banda),'.TIF'); +archivo=get_list_files(Carpeta_img,Busqueda); +FilePath=char(strcat(Carpeta_img,'/',archivo)); +[X, R] = geotiffread(FilePath); +%X es la matriz con valores 0 a 255 8bit, grayscale= 2 dim +%CMAP es el mapa de colores +%R es la referencia geoespacial +INFO = geotiffinfo(FilePath); +UTM.geokey=INFO.GeoTIFFTags.GeoKeyDirectoryTag; +UTM.tipo=INFO.Projection; +%pasa coordenadas a deg utm 19 N a deg +[x,y] = R.intrinsicToWorld(R.XLimIntrinsic,R.YLimIntrinsic); +i=1; +[lat(i,1),lon(i,1)] = projinv(INFO, x(i),y(i)); +i=2; +[lat(i,1),lon(i,1)] = projinv(INFO, x(i),y(i)); + %las posiciones intrinsecas corresponden a X(1,1) y X(n,m) +UTM.lat_deg=lat; +UTM.lon_deg=lon; +%Chile zona norte UTM 19 +Z_utm=19; +[UTM_X(1),UTM_Y(1)] = wgs2utm(lat(1),lon(1),Z_utm,Hemisferio); +[UTM_X(2),UTM_Y(2)] = wgs2utm(lat(2),lon(2),Z_utm,Hemisferio); +UTM.x=UTM_X; +UTM.y=UTM_Y; +%X es la matriz 0 255 DN5 +[n,m]=size(X); +DN7=zeros(n,m); +L_l=zeros(n,m); +R_l=zeros(n,m); +for i=1:n + for j=1:m + if X(i,j)>0 + if Landsat==5 + %los valores de DN7 + DN7(i,j)=(Slope(Banda)*X(i,j))+Intercep(Banda); + else + DN7(i,j)=X(i,j); + end + %la radianza es entonces + L_l(i,j)=Gain_radiance(Banda)*DN7(i,j)+Bias_radiance(Banda); + %la reflactancia es entonces: + %R= (%pi L d^2) / (Esun sin(Omega_se)) + R_l(i,j)=(pi*L_l(i,j)*distancia_ts^2)/(Esun_l(Banda)*sin(SUN_elevation_rad)); + if R_l(i,j)<0 + R_l(i,j)=0; + end + + end + end +end + +%calculo indice de vegetacion NDVI: (B4-B3)/(B4+B3) + +end \ No newline at end of file diff --git a/wgs2utm.m b/wgs2utm.m new file mode 100644 index 0000000..baca49f --- /dev/null +++ b/wgs2utm.m @@ -0,0 +1,155 @@ +function [x,y,utmzone,utmhemi] = wgs2utm(Lat,Lon,utmzone,utmhemi) +% ------------------------------------------------------------------------- +% [x,y,utmzone] = wgs2utm(Lat,Lon,Zone) +% +% Description: +% Convert WGS84 coordinates (Latitude, Longitude) into UTM coordinates +% (northing, easting) according to (optional) input UTM zone and +% hemisphere. +% +% Input: +% Lat: WGS84 Latitude scalar, vector or array in decimal degrees. +% Lon: WGS84 Longitude scalar, vector or array in decimal degrees. +% utmzone (optional): UTM longitudinal zone. Scalar or same size as Lat +% and Lon. +% utmhemi (optional): UTM hemisphere as a single character, 'N' or 'S', +% or array of 'N' or 'S' characters of same size as Lat and Lon. +% +% Output: +% x: UTM easting in meters. +% y: UTM northing in meters. +% utmzone: UTM longitudinal zone. +% utmhemi: UTM hemisphere as array of 'N' or 'S' characters. +% +% Author notes: +% I downloaded and tried deg2utm.m from Rafael Palacios but found +% differences of up to 1m with my reference converters in southern +% hemisphere so I wrote my own code based on "Map Projections - A +% Working Manual" by J.P. Snyder (1987). Quick quality control performed +% only by comparing with LINZ converter +% (www.linz.govt.nz/apps/coordinateconversions/) and Chuck Taylor's +% (http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html) on a +% few test points, so use results with caution. Equations not suitable +% for a latitude of +/- 90deg. +% +% UPDATE: Following requests, this new version allows forcing UTM zone +% in input. +% +% Examples: +% +% % set random latitude and longitude arrays +% Lat= 90.*(2.*rand(3)-1) +% Lon= 180.*(2.*rand(3)-1) +% +% % let the function find appropriate UTM zone and hemisphere from data +% [x1,y1,utmzone1,utmhemi1] = wgs2utm(Lat,Lon) +% +% % forcing unique UTM zone and hemisphere for all data entries +% % note: resulting easting and northing are way off the usual values +% [x2,y2,utmzone2,utmhemi2] = wgs2utm(Lat,Lon,60,'S') +% +% % forcing different UTM zone and hemisphere for each data entry +% % note: resulting easting and northing are way off the usual values +% utmzone = floor(59.*rand(3))+1 +% utmhemi = char(78 + 5.*round(rand(3))) +% [x3,y3,utmzone3,utmhemi3] = wgs2utm(Lat,Lon,utmzone,utmhemi) +% +% Author: +% Alexandre Schimel +% MetOcean Solutions Ltd +% New Plymouth, New Zealand +% +% Version 2: +% February 2011 +%------------------------------------------------------------------------- + +%% Argument checking +if ~sum(double(nargin==[2,4])) + error('Wrong number of input arguments');return +end +n1=size(Lat); +n2=size(Lon); +if (n1~=n2) + error('Lat and Lon should have same size');return +end +if exist('utmzone','var') && exist('utmhemi','var') + n3=size(utmzone); + n4=size(utmhemi); + if (sort(n3)~=sort(n4)) + error('utmzone and utmhemi should have same size');return + end + if max(n3)~=1 && max(n3)~=max(n1) + error('utmzone should have either same size as Lat and Long, or size=1');return + end +end + +% expand utmzone and utmhemi if needed +if exist('utmzone','var') && exist('utmhemi','var') + n3=size(utmzone); + n4=size(utmhemi); + if n3==[1 1] + utmzone = utmzone.*ones(size(Lat)); + utmhemi = char(utmhemi.*ones(size(Lat))); + end +end + +%% coordinates in radians +lat = Lat.*pi./180; +lon = Lon.*pi./180; + +%% WGS84 parameters +a = 6378137; %semi-major axis +b = 6356752.314245; %semi-minor axis +% b = 6356752.314140; %GRS80 value, originally used for WGS84 before refinements +e = sqrt(1-(b./a).^2); % eccentricity + +%% UTM parameters +% lat0 = 0; % reference latitude, not used here +if exist('utmzone','var') + Lon0 = 6.*utmzone-183; % reference longitude in degrees +else + Lon0 = floor(Lon./6).*6+3; % reference longitude in degrees +end +lon0 = Lon0.*pi./180; % in radians +k0 = 0.9996; % scale on central meridian + +FE = 500000; % false easting +if exist('utmhemi','var') + FN = double(utmhemi=='S').*10000000; +else + FN = (Lat < 0).*10000000; % false northing +end + +%% Equations parameters +eps = e.^2./(1-e.^2); % e prime square +% N: radius of curvature of the earth perpendicular to meridian plane +% Also, distance from point to polar axis +N = a./sqrt(1-e.^2.*sin(lat).^2); +T = tan(lat).^2; +C = ((e.^2)./(1-e.^2)).*(cos(lat)).^2; +A = (lon-lon0).*cos(lat); +% M: true distance along the central meridian from the equator to lat +M = a.*( ( 1 - e.^2./4 - 3.*e.^4./64 - 5.*e.^6./256 ) .* lat ... + -( 3.*e.^2./8 + 3.*e.^4./32 + 45.*e.^6./1024 ) .* sin(2.*lat) ... + +( 15.*e.^4./256 + 45.*e.^6./1024 ) .* sin(4.*lat) ... + -(35.*e.^6./3072 ) .* sin(6.*lat) ); + +%% easting +x = FE + k0.*N.*( A ... + + (1-T+C) .* A.^3./6 ... + + (5-18.*T+T.^2+72.*C-58.*eps) .* A.^5./120 ); + +%% northing +% M(lat0) = 0 so not used in following formula +y = FN + k0.*M + k0.*N.*tan(lat).*( A.^2./2 ... + + (5-T+9.*C+4.*C.^2) .* A.^4./24 ... + + (61-58.*T+T.^2+600.*C-330.*eps) .* A.^6./720 ); + +%% UTM zone +if exist('utmzone','var') && exist('utmhemi','var') + utmzone = utmzone; + utmhemi = utmhemi; +else + utmzone = floor(Lon0./6)+31; + utmhemi = char( 83.* (Lat < 0) + 78.* (Lat >= 0) ); +end \ No newline at end of file