Skip to content
Snippets Groups Projects
Commit 357ad946 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

rename format string by theFormat.

release R2014 give a warning about the use of matlab expression format
parent 2b564dde
No related branches found
No related tags found
No related merge requests found
...@@ -132,20 +132,20 @@ for k = keys(self) ...@@ -132,20 +132,20 @@ for k = keys(self)
for m = fieldnames(s)' for m = fieldnames(s)'
value = s.(char(m)); value = s.(char(m));
if islogical(value) if islogical(value)
format = '%d'; theFormat = '%d';
elseif iscell(value) elseif iscell(value)
format = '%s'; theFormat = '%s';
elseif isa(value,'char') elseif isa(value,'char')
format = '%s'; theFormat = '%s';
% else isa(value,'uint8') % else isa(value,'uint8')
% format = '%u'; % theFormat = '%u';
elseif isa(value,'integer') elseif isa(value,'integer')
format = '%d'; theFormat = '%d';
% format %g is used for scientific format 1e36 and %8.8g to write 99999.999 % format %g is used for scientific format 1e36 and %8.8g to write 99999.999
elseif isa(value,'single') elseif isa(value,'single')
format = '%8.8g'; theFormat = '%8.8g';
elseif isa(value,'double') elseif isa(value,'double')
format = '%8.8g'; theFormat = '%8.8g';
else else
error('dynaload.write: undefine %s value for member %s', .... error('dynaload.write: undefine %s value for member %s', ....
char(value), m); char(value), m);
...@@ -167,7 +167,7 @@ for k = keys(self) ...@@ -167,7 +167,7 @@ for k = keys(self)
else else
% use strtrim to remove blank (format %8.8g) % use strtrim to remove blank (format %8.8g)
% ------------------------------------------ % ------------------------------------------
str = strcat(str, strtrim(sprintf(strcat(format, ';'), value))); str = strcat(str, strtrim(sprintf(strcat(theFormat, ';'), value)));
end end
end end
end end
......
...@@ -55,17 +55,17 @@ for i=1:self.size; ...@@ -55,17 +55,17 @@ for i=1:self.size;
for j=1:nb; for j=1:nb;
switch type{j} switch type{j}
case 'char' case 'char'
format = '%s'; theFormat = '%s';
case 'byte' case 'byte'
format = '%u'; theFormat = '%u';
case 'integer' case 'integer'
format = '%d'; theFormat = '%d';
case 'float' case 'float'
format = '%f'; theFormat = '%f';
case 'double' case 'double'
format = '%lf'; theFormat = '%lf';
otherwise otherwise
format = '%s'; theFormat = '%s';
end end
switch j switch j
...@@ -80,7 +80,7 @@ for i=1:self.size; ...@@ -80,7 +80,7 @@ for i=1:self.size;
if isempty(value) if isempty(value)
str = [str, ';']; str = [str, ';'];
else else
str = [str, sprintf(strcat(format, ';'), value)]; str = [str, sprintf(strcat(theFormat, ';'), value)];
end end
end end
end end
......
...@@ -67,11 +67,11 @@ types = textscan(hdr{1}{2},'%s','delimiter',';'); ...@@ -67,11 +67,11 @@ types = textscan(hdr{1}{2},'%s','delimiter',';');
% generate one line format % generate one line format
% ------------------------ % ------------------------
format = repmat('%s', 1, numel(members{1})); theFormat = repmat('%s', 1, numel(members{1}));
% read end of file % read end of file
% ---------------- % ----------------
values = textscan(fid, format, 'delimiter',';'); values = textscan(fid, theFormat, 'delimiter',';');
% put header and members line to a hash, for next time when saving file % put header and members line to a hash, for next time when saving file
% --------------------------------------------------------------------- % ---------------------------------------------------------------------
......
% tsg_platform.csv: 15 members & 3 lines with data; VERSION = 1.4000 % tsg_platform.csv: 15 members & 1 lines with data; VERSION = 1.4200
% %
% %
id;PLATFORM_NAME;SHIP_CALL_SIGN;SHIP_MMSI;PROJECT_NAME;TYPE_TSG;NUMBER_TSG;TYPE_TINT;NUMBER_TINT;SAMPLING_PERIOD;SSPS_DEPH;SSPS_DEPH_MIN;SSPS_DEPH_MAX;SSTP_DEPH;SSTP_DEPH_MIN;SSTP_DEPH_MAX;DATE_TSG;endl id;PLATFORM_NAME;SHIP_CALL_SIGN;SHIP_MMSI;PROJECT_NAME;TYPE_TSG;NUMBER_TSG;TYPE_TINT;NUMBER_TINT;SAMPLING_PERIOD;SSPS_DEPH;SSPS_DEPH_MIN;SSPS_DEPH_MAX;SSTP_DEPH;SSTP_DEPH_MIN;SSTP_DEPH_MAX;DATE_TSG;endl
char;char;char;char;char;char;char;char;char;integer;integer;float;float;float;float;float;float;float char;char;char;char;char;char;char;char;char;integer;integer;float;float;float;float;float;float;float
#;toucan;;;;;;;;;5;4.000000;6.000000;NaN;NaN;NaN;;# #;CMA/CGM MATISSE;EGVL5;N/A;SO-SSS;SBE21;N/A;SBE38;N/A;5;0;NaN;NaN;NaN;NaN;NaN;NaN;#
#;FleurAustrale;;;;;;;;;0;NaN;NaN;NaN;NaN;NaN;;#
#;"MN TOUCAN";;;;;;;;;5;4.000000;6.000000;NaN;NaN;NaN;;#
<?xml version="1.0" encoding="UTF-8"?>
<deployment-project plugin="plugin.ezdeploy" plugin-version="1.0"> <deployment-project plugin="plugin.ezdeploy" plugin-version="1.0">
<configuration build-checksum="2815060340" file="C:\svn\tsg-qc\trunk\compiler\Windows (x86)\tsgqc.prj" location="C:\svn\tsg-qc\trunk\compiler\Windows (x86)" name="tsgqc" preferred-package-location="C:\svn\tsg-qc\trunk\compiler\Windows (x86)\tsgqc\for_redistribution" preferred-package-type="package.type.exe" target="target.ezdeploy.standalone" target-name="MATLAB Compiler for Standalone Applications"> <configuration target="target.ezdeploy.standalone" target-name="MATLAB Compiler for Standalone Applications" name="tsgqc" location="C:\svn\tsg-qc\trunk\compiler\Windows (x86)" file="C:\svn\tsg-qc\trunk\compiler\Windows (x86)\tsgqc.prj" preferred-package-type="package.type.exe" build-checksum="3510833430" preferred-package-location="C:\svn\tsg-qc\trunk\compiler\Windows (x86)\tsgqc\for_redistribution">
<param.appname>tsgqc</param.appname> <param.appname>tsgqc</param.appname>
<param.icon />
<param.icons />
<param.version>1.42</param.version>
<param.authnamewatermark>Jacques Grelet</param.authnamewatermark> <param.authnamewatermark>Jacques Grelet</param.authnamewatermark>
<param.email>Jacques.Grelet@ird.fr</param.email> <param.email>Jacques.Grelet@ird.fr</param.email>
<param.company>IRD</param.company> <param.company>IRD</param.company>
<param.icon />
<param.icons />
<param.summary>TSGQC standalone application. A tool for interactive quality control of sea surface temperature and salinity</param.summary> <param.summary>TSGQC standalone application. A tool for interactive quality control of sea surface temperature and salinity</param.summary>
<param.description>TSGQC is a software for interactive analysis and validation of underway SST / SSS (Sea Surface Temperature and Sea Surface Salinity) measurements from a SeaBird Thermosalinograph (TSG). It has been developed under Matlab.</param.description> <param.description>TSGQC is a software for interactive analysis and validation of underway SST / SSS (Sea Surface Temperature and Sea Surface Salinity) measurements from a SeaBird Thermosalinograph (TSG). It has been developed under Matlab.</param.description>
<param.screenshot>C:\svn\tsg-qc\trunk\tsg_icon\Thermo.jpg</param.screenshot> <param.screenshot>C:\svn\tsg-qc\trunk\tsg_icon\Thermo.jpg</param.screenshot>
<param.version>1.42</param.version>
<param.namespace>tsgqc</param.namespace>
<param.guid /> <param.guid />
<param.installpath.string>tsgqc</param.installpath.string> <param.installpath.string>tsgqc</param.installpath.string>
<param.installpath.combo>option.installpath.programfiles</param.installpath.combo> <param.installpath.combo>option.installpath.programfiles</param.installpath.combo>
<param.logo /> <param.logo />
<param.install.notes /> <param.install.notes />
<param.intermediate>${PROJECT_ROOT}\tsgqc\for_testing</param.intermediate> <param.intermediate>${PROJECT_ROOT}\tsgqc\for_testing</param.intermediate>
<param.files.only>${PROJECT_ROOT}\tsgqc\for_redistribution_files_only</param.files.only>
<param.output>${PROJECT_ROOT}\tsgqc\for_redistribution</param.output> <param.output>${PROJECT_ROOT}\tsgqc\for_redistribution</param.output>
<param.enable.clean.build>false</param.enable.clean.build>
<param.user.defined.mcr.options />
<param.embed.ctf>true</param.embed.ctf> <param.embed.ctf>true</param.embed.ctf>
<param.server.ctf>${PROJECT_ROOT}\tsgqc\for_testing\.ctf</param.server.ctf>
<param.server.readme>${PROJECT_ROOT}\tsgqc\for_testing\readme.txt</param.server.readme>
<param.target.type>subtarget.standalone</param.target.type> <param.target.type>subtarget.standalone</param.target.type>
<param.support.packages /> <param.classorg />
<param.required.mcr.products />
<param.web.mcr>true</param.web.mcr> <param.web.mcr>true</param.web.mcr>
<param.package.mcr>true</param.package.mcr> <param.package.mcr>true</param.package.mcr>
<param.no.mcr>false</param.no.mcr> <param.no.mcr>false</param.no.mcr>
<param.web.mcr.name>TSQQC_Installer_web</param.web.mcr.name> <param.web.mcr.name>TSQQC_Installer_web</param.web.mcr.name>
<param.package.mcr.name>TSGQC_AppInstaller_mcr</param.package.mcr.name> <param.package.mcr.name>TSGQC_AppInstaller_mcr</param.package.mcr.name>
<param.no.mcr.name>MyAppInstaller_app</param.no.mcr.name> <param.no.mcr.name>MyAppInstaller_app</param.no.mcr.name>
<param.user.defined.mcr.options />
<param.windows.command.prompt>false</param.windows.command.prompt> <param.windows.command.prompt>false</param.windows.command.prompt>
<param.user.only.registration>false</param.user.only.registration>
<param.mads.no.java>false</param.mads.no.java>
<param.mads.exclusive.mcr>false</param.mads.exclusive.mcr>
<param.net.framework>option.net.framework.default</param.net.framework>
<param.assembly.type>false</param.assembly.type>
<param.encryption.key.file />
<param.net.enable.remoting>false</param.net.enable.remoting>
<param.net.tsa.enable>false</param.net.tsa.enable>
<param.net.tsa.assembly />
<param.net.tsa.interface />
<param.net.tsa.namespace>tsgqc</param.net.tsa.namespace>
<param.net.tsa.superclass />
<param.net.tsa.metadata />
<param.net.tsa.metadata.assembly>C:\Users\jgrelet\Documents\MATLAB</param.net.tsa.metadata.assembly>
<param.create.log>false</param.create.log> <param.create.log>false</param.create.log>
<param.log.file /> <param.log.file />
<unset> <unset>
<param.authnamewatermark />
<param.email />
<param.company />
<param.icon /> <param.icon />
<param.icons /> <param.icons />
<param.namespace />
<param.guid /> <param.guid />
<param.logo /> <param.logo />
<param.install.notes /> <param.install.notes />
<param.intermediate /> <param.intermediate />
<param.files.only />
<param.output /> <param.output />
<param.enable.clean.build />
<param.user.defined.mcr.options />
<param.embed.ctf /> <param.embed.ctf />
<param.server.ctf />
<param.server.readme />
<param.target.type /> <param.target.type />
<param.support.packages /> <param.classorg />
<param.required.mcr.products />
<param.web.mcr /> <param.web.mcr />
<param.no.mcr /> <param.no.mcr />
<param.no.mcr.name /> <param.no.mcr.name />
<param.user.defined.mcr.options />
<param.user.only.registration />
<param.mads.no.java />
<param.mads.exclusive.mcr />
<param.net.framework />
<param.assembly.type />
<param.encryption.key.file />
<param.net.enable.remoting />
<param.net.tsa.enable />
<param.net.tsa.assembly />
<param.net.tsa.interface />
<param.net.tsa.namespace />
<param.net.tsa.superclass />
<param.net.tsa.metadata />
<param.net.tsa.metadata.assembly />
<param.create.log /> <param.create.log />
<param.log.file /> <param.log.file />
</unset> </unset>
...@@ -437,13 +461,12 @@ ...@@ -437,13 +461,12 @@
</fileset.resources> </fileset.resources>
<fileset.package /> <fileset.package />
<build-deliverables> <build-deliverables>
<file location="${PROJECT_ROOT}\tsgqc\for_testing" name="splash.png" optional="false">C:\svn\tsg-qc\trunk\compiler\Windows (x86)\tsgqc\for_testing\splash.png</file> <file name="readme.txt" location="${PROJECT_ROOT}\tsgqc\for_testing" optional="true">C:\svn\tsg-qc\trunk\compiler\Windows (x86)\tsgqc\for_testing\readme.txt</file>
<file location="${PROJECT_ROOT}\tsgqc\for_testing" name="readme.txt" optional="true">C:\svn\tsg-qc\trunk\compiler\Windows (x86)\tsgqc\for_testing\readme.txt</file> <file name="tsgqc.exe" location="${PROJECT_ROOT}\tsgqc\for_testing" optional="false">C:\svn\tsg-qc\trunk\compiler\Windows (x86)\tsgqc\for_testing\tsgqc.exe</file>
<file location="${PROJECT_ROOT}\tsgqc\for_testing" name="tsgqc.exe" optional="false">C:\svn\tsg-qc\trunk\compiler\Windows (x86)\tsgqc\for_testing\tsgqc.exe</file>
</build-deliverables> </build-deliverables>
<workflow /> <workflow />
<matlab> <matlab>
<root>C:\Program Files (x86)\MATLAB\R2014b</root> <root>C:\Program Files\MATLAB\R2013b</root>
<toolboxes /> <toolboxes />
</matlab> </matlab>
<platform> <platform>
...@@ -456,10 +479,11 @@ ...@@ -456,10 +479,11 @@
<linux>false</linux> <linux>false</linux>
<solaris>false</solaris> <solaris>false</solaris>
<osver>6.1</osver> <osver>6.1</osver>
<os32>true</os32> <os32>false</os32>
<os64>false</os64> <os64>true</os64>
<arch>win32</arch> <arch>win64</arch>
<matlab>true</matlab> <matlab>true</matlab>
</platform> </platform>
</configuration> </configuration>
</deployment-project> </deployment-project>
\ No newline at end of file
...@@ -43,7 +43,7 @@ function [date, time, lat, lon, sst, sss, sssStd, cond, condRaw, sog, cog, flow] ...@@ -43,7 +43,7 @@ function [date, time, lat, lon, sst, sss, sssStd, cond, condRaw, sog, cog, flow]
% Je cree ici la chaine de caractere decrivant le format utilise par % Je cree ici la chaine de caractere decrivant le format utilise par
% textscan. Modifie par jg avec repmat % textscan. Modifie par jg avec repmat
% -------------------------------------------------------------- % --------------------------------------------------------------
format = repmat(' %s', 1, nPara); theFormat = repmat(' %s', 1, nPara);
% textscan permet de lire a peu pres tout, memes les lignes % textscan permet de lire a peu pres tout, memes les lignes
% incompletes, plus courtes. % incompletes, plus courtes.
...@@ -53,7 +53,7 @@ function [date, time, lat, lon, sst, sss, sssStd, cond, condRaw, sog, cog, flow] ...@@ -53,7 +53,7 @@ function [date, time, lat, lon, sst, sss, sssStd, cond, condRaw, sog, cog, flow]
% dans le cas de lignes incompletes textscan n'utilise pas % dans le cas de lignes incompletes textscan n'utilise pas
% enptyValue mais une chaine de caracteres vide % enptyValue mais une chaine de caracteres vide
% ----------------------------------------------------------- % -----------------------------------------------------------
data = textscan(fid, format, 'delimiter', DELIMITER, 'emptyValue', NaN); data = textscan(fid, theFormat, 'delimiter', DELIMITER, 'emptyValue', NaN);
% Remplace les chaines de caracteres vides par des NaN % Remplace les chaines de caracteres vides par des NaN
% ---------------------------------------------------- % ----------------------------------------------------
......
...@@ -91,20 +91,20 @@ end ...@@ -91,20 +91,20 @@ end
% %HEADER YEAR MNTH DAYX hh mm ss % %HEADER YEAR MNTH DAYX hh mm ss
% 2 - The 6 Date and time parameters are read in %d % 2 - The 6 Date and time parameters are read in %d
% ------------------------------------------------------------- % -------------------------------------------------------------
format = '%d %d %d %d %d %d'; theFormat = '%d %d %d %d %d %d';
for i = 7 : nHeader for i = 7 : nHeader
if isempty( strfind(char(header(i)), 'TYPE')) && ... if isempty( strfind(char(header(i)), 'TYPE')) && ...
isempty( strfind( char(header(i)), 'BOTTLE') ) && ... isempty( strfind( char(header(i)), 'BOTTLE') ) && ...
isempty( strfind( char(header(i)), 'ANALDATE') ); isempty( strfind( char(header(i)), 'ANALDATE') );
format = [format ' %f']; theFormat = [theFormat ' %f'];
else else
format = [format ' %s']; theFormat = [theFormat ' %s'];
end end
end end
% Read the data in a cell % Read the data in a cell
% ----------------------- % -----------------------
cellData = textscan( fid, format ); cellData = textscan( fid, theFormat );
% Convert cell to a structure % Convert cell to a structure
% --------------------------- % ---------------------------
......
...@@ -116,11 +116,11 @@ end ...@@ -116,11 +116,11 @@ end
% %HEADER YEAR MNTH DAYX hh mm ss % %HEADER YEAR MNTH DAYX hh mm ss
% 2 - The 6 Date and time parametes are read in %d % 2 - The 6 Date and time parametes are read in %d
% ------------------------------------------------------------- % -------------------------------------------------------------
format = strcat('%d %d %d %d %d %d', repmat(' %f', 1, nHeader - 6)); theFormat = strcat('%d %d %d %d %d %d', repmat(' %f', 1, nHeader - 6));
% Read the data in a cell % Read the data in a cell
% ----------------------- % -----------------------
cellData = textscan( fid, format ); cellData = textscan( fid, theFormat );
% Convert cell to a structure % Convert cell to a structure
% --------------------------- % ---------------------------
......
...@@ -102,14 +102,14 @@ end ...@@ -102,14 +102,14 @@ end
% %HEADER YEAR MNTH DAYX hh mm ss % %HEADER YEAR MNTH DAYX hh mm ss
% 2 - The 4 Date and time parametes are read in %d % 2 - The 4 Date and time parametes are read in %d
% ------------------------------------------------------------- % -------------------------------------------------------------
format = '%d %d %d %d'; theFormat = '%d %d %d %d';
for i = 5 : nHeader for i = 5 : nHeader
format = [format ' %f']; theFormat = [theFormat ' %f'];
end end
% Read the data in a cell % Read the data in a cell
% ----------------------- % -----------------------
cellData = textscan( fid, format ); cellData = textscan( fid, theFormat );
% Convert cell to a structure % Convert cell to a structure
% --------------------------- % ---------------------------
......
...@@ -54,11 +54,11 @@ fprintf('...reading %s : ', filename); ...@@ -54,11 +54,11 @@ fprintf('...reading %s : ', filename);
% Columns are: % Columns are:
% ? ship_name yyyy mm dd HHMM latx lonx ssjt ssps (sstp sstp_qc) % ? ship_name yyyy mm dd HHMM latx lonx ssjt ssps (sstp sstp_qc)
% --------------------------------------------------------------------- % ---------------------------------------------------------------------
format = '%d %s %f %f %f %4c %f %f %f %f %f %d'; theFormat = '%d %s %f %f %f %4c %f %f %f %f %f %d';
% Read the data in a cell % Read the data in a cell
% ----------------------- % -----------------------
cellData = textscan( fid, format ); cellData = textscan( fid, theFormat );
% Check the file is for NUKA ship % Check the file is for NUKA ship
% ----------------------------------- % -----------------------------------
......
...@@ -53,11 +53,11 @@ fprintf('...reading %s : ', filename); ...@@ -53,11 +53,11 @@ fprintf('...reading %s : ', filename);
% Columns are: % Columns are:
% yyyy/mm/dd HH:MM(:SS) latx lonx ssjt ssps ? % yyyy/mm/dd HH:MM(:SS) latx lonx ssjt ssps ?
% ------------------------------------------- % -------------------------------------------
format = '%s %s %f %f %f %f %d'; theFormat = '%s %s %f %f %f %f %d';
% Read the data in a cell % Read the data in a cell
% ----------------------- % -----------------------
cellData = textscan( fid, format ); cellData = textscan( fid, theFormat );
nrecords=length(cellData{1}); nrecords=length(cellData{1});
% Fill TSG attributes (extracted from filename) % Fill TSG attributes (extracted from filename)
......
...@@ -52,11 +52,11 @@ fprintf('...reading %s : ', filename); ...@@ -52,11 +52,11 @@ fprintf('...reading %s : ', filename);
% Columns are: % Columns are:
% ? call_sign cyc_mes yyyymmddHHMM 100*latx 100*lonx 100*ssjt 1000*ssps % ? call_sign cyc_mes yyyymmddHHMM 100*latx 100*lonx 100*ssjt 1000*ssps
% --------------------------------------------------------------------- % ---------------------------------------------------------------------
format = '%s %s %s %s %d %d %d %d %d'; theFormat = '%s %s %s %s %d %d %d %d %d';
% Read the data in a cell % Read the data in a cell
% ----------------------- % -----------------------
cellData = textscan( fid, format ); cellData = textscan( fid, theFormat );
% Check the file is for a single ship/trip % Check the file is for a single ship/trip
% ---------------------------------------- % ----------------------------------------
......
...@@ -57,9 +57,9 @@ if choice ...@@ -57,9 +57,9 @@ if choice
tsg_data = [year month day hour min fix(sec) tsg.LATX_EXT tsg.LONX_EXT ]; tsg_data = [year month day hour min fix(sec) tsg.LATX_EXT tsg.LONX_EXT ];
header = 'YEAR MNTH DAYX hh mi ss LATX_EXT LONX_EXT'; header = 'YEAR MNTH DAYX hh mi ss LATX_EXT LONX_EXT';
format = '%04d %02d %02d %02d %02d %02d %12.7f %12.7f'; theFormat = '%04d %02d %02d %02d %02d %02d %12.7f %12.7f';
for i = 1:nbRecords for i = 1:nbRecords
data(i, :) = sprintf( format, tsg_data(i,:) ); data(i, :) = sprintf( theFormat, tsg_data(i,:) );
end end
for i = 1 : length(colParaNo) for i = 1 : length(colParaNo)
......
...@@ -65,7 +65,7 @@ if choice ...@@ -65,7 +65,7 @@ if choice
tsg_data = [year month day hour min fix(sec) tsg.LATX mod(tsg.LONX+180,360)-180 ]; tsg_data = [year month day hour min fix(sec) tsg.LATX mod(tsg.LONX+180,360)-180 ];
header = 'YEAR MNTH DAYX hh mi ss LATX LONX'; header = 'YEAR MNTH DAYX hh mi ss LATX LONX';
format = '%04d %02d %02d %02d %02d %02d %12.7f %12.7f'; theFormat = '%04d %02d %02d %02d %02d %02d %12.7f %12.7f';
for i = 1 : length(colParaNo) for i = 1 : length(colParaNo)
para = PARA{colParaNo(i)}; para = PARA{colParaNo(i)};
...@@ -76,13 +76,13 @@ if choice ...@@ -76,13 +76,13 @@ if choice
if findstr( '_QC', para) if findstr( '_QC', para)
tsg_data = [tsg_data double(tsg.(para))]; tsg_data = [tsg_data double(tsg.(para))];
format = [format ' %1d']; theFormat = [theFormat ' %1d'];
elseif findstr( '_FREQ', para) elseif findstr( '_FREQ', para)
tsg_data = [tsg_data tsg.(para)]; tsg_data = [tsg_data tsg.(para)];
format = [format ' %f']; theFormat = [theFormat ' %f'];
else else
tsg_data = [tsg_data tsg.(para)]; tsg_data = [tsg_data tsg.(para)];
format = [format ' %6.3f']; theFormat = [theFormat ' %6.3f'];
end end
header = [header ' ' para]; header = [header ' ' para];
...@@ -115,7 +115,7 @@ if choice ...@@ -115,7 +115,7 @@ if choice
% -------------- % --------------
fprintf( fid, '%%HEADER %s\n', header); fprintf( fid, '%%HEADER %s\n', header);
fprintf(fid, [format '\n'], tsg_data'); fprintf(fid, [theFormat '\n'], tsg_data');
% Clear the Workspace % Clear the Workspace
% ------------------- % -------------------
......
...@@ -45,9 +45,9 @@ if ~isequal(file, 0) ...@@ -45,9 +45,9 @@ if ~isequal(file, 0)
% Je cree ici la chaine de caractere decrivant le format utilise par % Je cree ici la chaine de caractere decrivant le format utilise par
% textscan % textscan
% ---------------------------------------------------------------------- % ----------------------------------------------------------------------
format = []; theFormat = [];
for i = 1:NBELEMENT for i = 1:NBELEMENT
format = [format ' %s']; theFormat = [theFormat ' %s'];
end end
% Ouverture du fichier en lecture '.CSV' % Ouverture du fichier en lecture '.CSV'
...@@ -98,7 +98,7 @@ if ~isequal(file, 0) ...@@ -98,7 +98,7 @@ if ~isequal(file, 0)
% dans le cas de lignes incompletes textscan n'utilise pas % dans le cas de lignes incompletes textscan n'utilise pas
% enptyValue mais une chaine de caracteres vide % enptyValue mais une chaine de caracteres vide
% ----------------------------------------------------------- % -----------------------------------------------------------
data = textscan(fid, format, 'delimiter', DELIMITER,... data = textscan(fid, theFormat, 'delimiter', DELIMITER,...
'headerLines', 0 ,... 'headerLines', 0 ,...
'treatAsEmpty', ' ',... 'treatAsEmpty', ' ',...
'emptyValue', NaN); 'emptyValue', NaN);
...@@ -268,9 +268,9 @@ if ~isequal(file, 0) ...@@ -268,9 +268,9 @@ if ~isequal(file, 0)
% Cree un tableau de caracteres avec toutes les informations % Cree un tableau de caracteres avec toutes les informations
% ---------------------------------------------------------- % ----------------------------------------------------------
bucket = [year month day hour min sec latitude longitude sss_buck code]; bucket = [year month day hour min sec latitude longitude sss_buck code];
format = '%04d %02d %02d %02d %02d %02d %12.7f %12.7f %6.3f %d'; theFormat = '%04d %02d %02d %02d %02d %02d %12.7f %12.7f %6.3f %d';
for i = 1:nbRecords for i = 1:nbRecords
bucketStr(i, :) = sprintf( format, bucket(i,:) ); bucketStr(i, :) = sprintf( theFormat, bucket(i,:) );
end end
% Concatene le type et la date d'analyse % Concatene le type et la date d'analyse
......
...@@ -130,7 +130,7 @@ for i = 1 : nfiles ...@@ -130,7 +130,7 @@ for i = 1 : nfiles
%[year, month, day, hour, min, sec] = datevec( julianToDatenum(tsg.DAYD) ); %[year, month, day, hour, min, sec] = datevec( julianToDatenum(tsg.DAYD) );
tsg_data = [year month day hour min fix(sec) tsg.LATX mod(tsg.LONX+180,360)-180 ]; tsg_data = [year month day hour min fix(sec) tsg.LATX mod(tsg.LONX+180,360)-180 ];
header = 'YEAR MNTH DAYX hh mi ss LATX LONX'; header = 'YEAR MNTH DAYX hh mi ss LATX LONX';
format = '%04d %02d %02d %02d %02d %02d %12.7f %12.7f'; theFormat = '%04d %02d %02d %02d %02d %02d %12.7f %12.7f';
% Boucle sur les paramtres sauvegarder % Boucle sur les paramtres sauvegarder
% --------------------------------------- % ---------------------------------------
...@@ -154,10 +154,10 @@ for i = 1 : nfiles ...@@ -154,10 +154,10 @@ for i = 1 : nfiles
tsg.(para)(ind) = 0; tsg.(para)(ind) = 0;
end end
tsg_data = [tsg_data double(tsg.(para))]; tsg_data = [tsg_data double(tsg.(para))];
format = [format ' %1d']; theFormat = [theFormat ' %1d'];
else else
tsg_data = [tsg_data tsg.(para)]; tsg_data = [tsg_data tsg.(para)];
format = [format ' %6.3f']; theFormat = [theFormat ' %6.3f'];
end end
header = [header ' ' para]; header = [header ' ' para];
...@@ -187,7 +187,7 @@ for i = 1 : nfiles ...@@ -187,7 +187,7 @@ for i = 1 : nfiles
% Write the file % Write the file
% -------------- % --------------
fprintf( fid, '%%HEADER %s\n', header); fprintf( fid, '%%HEADER %s\n', header);
fprintf( fid, [format '\n'], tsg_data'); fprintf( fid, [theFormat '\n'], tsg_data');
% Everything OK % Everything OK
% ------------- % -------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment