annotate private/EDB1readsetup.m @ 18:2d5f50205527 jabuilder_int tip

Escape the trailing backslash as well
author Chris Cannam
date Tue, 30 Sep 2014 16:23:00 +0100
parents d9262cdbfb38
children
rev   line source
tp@0 1 function setupmatfile = EDB1readsetup(EDsetupfile,cadgeofiletoopen)
tp@0 2 % EDB1readsetup - Runs the EDsetup m-file and saves all the settings in a mat-file.
tp@0 3 % If the sources and receivers should be taken from the
tp@0 4 % CAD-file, they will be extracted and saved in the setupmatfile.
tp@0 5 %
tp@0 6 % Input parameters:
tp@0 7 % EDsetupfile The name of the EDsetupfile (an m-file) that
tp@0 8 % should be read.
tp@0 9 % cadgeofiletoopen (optional) If the CAD file has already been read
tp@0 10 % and stored as a cadgeofile, the cadgeofile could
tp@0 11 % be used instead of the CAD-file.
tp@0 12 % SHOWTEXT (global) Determines to what degree text will be printed out on the screen.
tp@0 13 %
tp@0 14 % Output parameters:
tp@0 15 % setupmatfile The name of the output file. The name is created
tp@0 16 % from the Filestem in the setupfile, with
tp@0 17 % "_setup.mat" added.
tp@0 18 %
tp@0 19 % ----------------------------------------------------------------------------------------------
tp@0 20 % This file is part of the Edge Diffraction Toolbox by Peter Svensson.
tp@0 21 %
tp@0 22 % The Edge Diffraction Toolbox is free software: you can redistribute it and/or modify
tp@0 23 % it under the terms of the GNU General Public License as published by the Free Software
tp@0 24 % Foundation, either version 3 of the License, or (at your option) any later version.
tp@0 25 %
tp@0 26 % The Edge Diffraction Toolbox is distributed in the hope that it will be useful,
tp@0 27 % but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
tp@0 28 % FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
tp@0 29 %
tp@0 30 % You should have received a copy of the GNU General Public License along with the
tp@0 31 % Edge Diffraction Toolbox. If not, see <http://www.gnu.org/licenses/>.
tp@0 32 % ----------------------------------------------------------------------------------------------
tp@0 33 % Peter Svensson (svensson@iet.ntnu.no) 20100518
tp@0 34 %
tp@0 35 % setupmatfile = EDB1readsetup(EDsetupfile,cadgeofile);
tp@0 36
tp@0 37 global SHOWTEXT
tp@0 38
tp@0 39 if nargin == 1
tp@0 40 cadgeofiletoopen = [];
tp@0 41 end
tp@0 42
luis@9 43 % keeping the original filename, will use it later --luisf.
luis@9 44 setup_fname = EDsetupfile;
luis@9 45
tp@0 46 [EDsetupfilepath,EDsetupfile,fileext] = fileparts(EDsetupfile);
tp@0 47 EDsetupfilepath = [EDsetupfilepath,filesep];
tp@0 48
luis@9 49 % this is no longer necessary --luisf.
luis@9 50 % eval(['cd ''',EDsetupfilepath,''''])
tp@0 51
tp@0 52 comptype = computer;
tp@0 53 if length(comptype) == 3
tp@0 54 comptype = [comptype,'P'];
tp@0 55 end
tp@0 56
luis@9 57 % this doesn't work, need to read the file manually --luisf.
luis@9 58
luis@9 59 % if comptype(1:4) == 'MACI'
luis@9 60 % [temp1,tempfilestem,temp2] = fileparts(EDsetupfile);
luis@9 61 % eval([tempfilestem])
luis@9 62 % else
luis@9 63 % if comptype(1:3) == 'MAC', % | comptype(1:3) == 'PCW'
luis@9 64 % eval([EDsetupfile])
luis@9 65 % else
luis@9 66 % eval(['run ''',EDsetupfile,''''])
luis@9 67 % end
luis@9 68 % end
luis@9 69
luis@9 70 eval(char(textread(setup_fname, '%s', 'whitespace', '')));
luis@9 71
luis@9 72 % ~luisf
tp@0 73
tp@0 74 if exist('Filestem') ~= 1
tp@0 75 error(['ERROR: The setup file does not specify the Filestem'])
tp@0 76 else
tp@0 77 Varlist = [' Filestem'];
tp@0 78 end
tp@0 79
tp@0 80 %-----------------------------------------------------------------------------------------
tp@0 81 % Check if the EDsetupfile specified the needed parameters
tp@0 82
tp@0 83 if isempty(FSAMP)
tp@0 84 error(['ERROR: FSAMP was not specified in ',EDsetupfile,'.m'])
tp@0 85 else
tp@0 86 Varlist = [Varlist,' FSAMP'];
tp@0 87 end
tp@0 88
tp@0 89 if isempty(RHOAIR)
tp@0 90 error(['ERROR: RHOAIR was not specified in ',EDsetupfile,'.m'])
tp@0 91 else
tp@0 92 Varlist = [Varlist,' RHOAIR'];
tp@0 93 end
tp@0 94
tp@0 95 if isempty(CAIR)
tp@0 96 error(['ERROR: CAIR was not specified in ',EDsetupfile,'.m'])
tp@0 97 else
tp@0 98 Varlist = [Varlist,' CAIR'];
tp@0 99 end
tp@0 100
tp@0 101 if exist('Filepath') ~= 1
tp@0 102 error(['ERROR: Filepath was not specified in ',EDsetupfile,'.m'])
tp@0 103 else
tp@0 104 Varlist = [Varlist,' Filepath'];
tp@0 105 end
tp@0 106
tp@0 107 if exist('Filestem') ~= 1
tp@0 108 error(['ERROR: Filestem was not specified in ',EDsetupfile,'.m'])
tp@0 109 else
tp@0 110 Varlist = [Varlist,' Filestem'];
tp@0 111 end
tp@0 112
tp@0 113 if (exist('CADfile') ~= 1) & isempty(cadgeofiletoopen)
tp@0 114 error(['ERROR: CADfile or cadgeofile was not specified in ',EDsetupfile,'.m'])
tp@0 115 else
tp@0 116 if exist('CADfile') == 1
tp@0 117 Varlist = [Varlist,' CADfile'];
tp@0 118 else
tp@0 119 if exist('cadgeofiletoopen')
tp@0 120 cadgeofile = cadgeofiletoopen;
tp@0 121 Varlist = [Varlist,' cadgeofile'];
tp@0 122 end
tp@0 123 end
tp@0 124 end
tp@0 125
tp@0 126 if exist('open_or_closed_model') ~= 1
tp@0 127 error(['ERROR: open_or_closed_model was not specified in ',EDsetupfile,'.m',' Valid values are ''open'' and ''closed'''])
tp@0 128 else
tp@0 129 Varlist = [Varlist,' open_or_closed_model'];
tp@0 130 end
tp@0 131
tp@0 132 if exist('int_or_ext_model') ~= 1
tp@0 133 error(['ERROR: int_or_ext_model was not specified in ',EDsetupfile,'.m',' Valid values are ''int'' and ''ext'''])
tp@0 134 else
tp@0 135 Varlist = [Varlist,' int_or_ext_model'];
tp@0 136 end
tp@0 137
tp@0 138 if lower(open_or_closed_model(1)) == 'o' & lower(int_or_ext_model(1)) == 'i'
tp@0 139 error(['ERROR: When a model is open, it must be an external model. int_or_ext_model was set to ''int'''])
tp@0 140 end
tp@0 141
tp@0 142 if exist('EDcalcmethod') ~= 1
tp@0 143 error(['ERROR: EDcalcmethod was not specified in ',EDsetupfile,'.m',' Valid values are n,k,v'])
tp@0 144 else
tp@0 145 Varlist = [Varlist,' EDcalcmethod'];
tp@0 146 end
tp@0 147
tp@0 148 if exist('directsound') ~= 1
tp@0 149 error(['ERROR: directsound was not specified in ',EDsetupfile,'.m',' Valid values are 0 and 1'])
tp@0 150 else
tp@0 151 Varlist = [Varlist,' directsound'];
tp@0 152 end
tp@0 153
tp@0 154 if exist('specorder') ~= 1
tp@0 155 error(['ERROR: specorder was not specified in ',EDsetupfile,'.m',' Valid values are integers >= 0'])
tp@0 156 else
tp@0 157 Varlist = [Varlist,' specorder'];
tp@0 158 end
tp@0 159
tp@0 160 if exist('difforder') ~= 1
tp@0 161 error(['ERROR: difforder was not specified in ',EDsetupfile,'.m',' Valid values are integers >= 0'])
tp@0 162 else
tp@0 163 Varlist = [Varlist,' difforder'];
tp@0 164 end
tp@0 165
tp@0 166 if specorder < difforder
tp@0 167 error(['ERROR: specorder must be the same as, or larger than, difforder in this version of EDtoolbox!'])
tp@0 168 end
tp@0 169
tp@0 170 if difforder >=2
tp@0 171 if exist('elemsize') ~= 1
tp@0 172 error(['ERROR: elemsize was not specified in ',EDsetupfile,'.m'])
tp@0 173 else
tp@0 174 if min(elemsize) <= 0
tp@0 175 disp(['WARNING: elemsize was set smaller than zero'])
tp@0 176 else
tp@0 177 if length(elemsize) < difforder
tp@0 178 error(['ERROR: elemsize must have one value for each diffraction order'])
tp@0 179 else
tp@0 180 Varlist = [Varlist,' elemsize'];
tp@0 181 end
tp@0 182 end
tp@0 183 end
tp@0 184 end
tp@0 185
tp@0 186 if exist('sources') ~= 1
tp@0 187 error(['ERROR: sources were not specified in ',EDsetupfile,'.m'])
tp@0 188 else
tp@0 189 Varlist = [Varlist,' sources'];
tp@0 190 [nsou,slask] = size(sources);
tp@0 191 end
tp@0 192
tp@0 193 if exist('receivers') ~= 1
tp@0 194 error(['ERROR: receivers were not specified in ',EDsetupfile,'.m'])
tp@0 195 else
tp@0 196 Varlist = [Varlist,' receivers'];
tp@0 197 end
tp@0 198
tp@0 199 %---------------------------------------------------------------------
tp@0 200 % Optional parameters that should get a default value
tp@0 201
tp@0 202 if isempty(SHOWTEXT)
tp@0 203 disp([' The parameter SHOWTEXT was not set. It will get the default value 0.'])
tp@0 204 SHOWTEXT = 0;
tp@0 205 end
tp@0 206 Varlist = [Varlist,' SHOWTEXT'];
tp@0 207
tp@0 208 if exist('SUPPRESSFILES') ~= 1
tp@0 209 disp([' The parameter SUPPRESSFILES was not set. It will get the default value 0.'])
tp@0 210 SUPPRESSFILES = 0;
tp@0 211 end
tp@0 212 Varlist = [Varlist,' SUPPRESSFILES'];
tp@0 213
tp@0 214 if exist('nedgesubs') ~= 1
tp@0 215 if SHOWTEXT > 0
tp@0 216 disp([' The parameter nedgesubs was not set. It will get the default value 2.'])
tp@0 217 end
tp@0 218 nedgesubs = 2;
tp@0 219 else
tp@0 220 if nedgesubs == 1
tp@0 221 nedgesubs = 2;
tp@0 222 if SHOWTEXT > 0
tp@0 223 disp('WARNING! nedgesubs was set to 1 in the setup file but it is forced to 2')
tp@0 224 end
tp@0 225 end
tp@0 226 end
tp@0 227 Varlist = [Varlist,' nedgesubs'];
tp@0 228
tp@0 229 if exist('saveindividualdiffirs') ~= 1
tp@0 230 if SHOWTEXT > 0
tp@0 231 disp([' The parameter saveindividualdiffirs was not set. It will get the default value [0 0].'])
tp@0 232 end
tp@0 233 saveindividualdiffirs = [0 0];
tp@0 234 else
tp@0 235 if length(saveindividualdiffirs) == 1
tp@0 236 if SHOWTEXT > 0
tp@0 237 disp([' The parameter saveindividualdiffirs had just one value. It was expanded with a second default value 0.'])
tp@0 238 end
tp@0 239 saveindividualdiffirs = [saveindividualdiffirs 0];
tp@0 240 end
tp@0 241 end
tp@0 242 Varlist = [Varlist,' saveindividualdiffirs'];
tp@0 243
tp@0 244 if exist('firstskipcorner') ~= 1
tp@0 245 if SHOWTEXT > 0
tp@0 246 disp([' The parameter firstskipcorner was not set. It will get the default value 1000000.'])
tp@0 247 end
tp@0 248 firstskipcorner = 1000000;
tp@0 249 end
tp@0 250 Varlist = [Varlist,' firstskipcorner'];
tp@0 251
tp@0 252 if exist('doaddsources') ~= 1
tp@0 253 if nsou > 1
tp@0 254 disp([' The parameter doaddsources was not set. It will get the default value 0.'])
tp@0 255 end
tp@0 256 doaddsources = 0;
tp@0 257 end
tp@0 258 Varlist = [Varlist,' doaddsources'];
tp@0 259
tp@0 260 if exist('dobackscatter') ~= 1
tp@0 261 dobackscatter = 0;
tp@0 262 end
tp@0 263 Varlist = [Varlist,' dobackscatter'];
tp@0 264
tp@0 265 if dobackscatter*doaddsources == 1
tp@0 266 error(['ERROR: You have set both dobackscatter and doaddsources to 1. This does not make sense!'])
tp@0 267 end
tp@0 268
tp@0 269 if exist('Rstart') ~= 1
tp@0 270 if SHOWTEXT > 0
tp@0 271 disp([' The parameter Rstart was not set. It will get the default value 0.'])
tp@0 272 end
tp@0 273 Rstart = 0;
tp@0 274 end
tp@0 275 Varlist = [Varlist,' Rstart'];
tp@0 276
tp@0 277 if exist('planeseesplanestrategy') ~= 1
tp@0 278 if SHOWTEXT > 0
tp@0 279 disp([' The parameter planeseesplanestrategy was not set. It will get the default value 0.'])
tp@0 280 end
tp@0 281 planeseesplanestrategy = 0;
tp@0 282 end
tp@0 283 Varlist = [Varlist,' planeseesplanestrategy'];
tp@0 284
tp@0 285 %---------------------------------------------------------------------
tp@0 286 % Optional parameters
tp@0 287
tp@0 288 if exist('eddatafile')
tp@0 289 Varlist = [Varlist,' eddatafile'];
tp@0 290 end
tp@0 291 if exist('srdatafile')
tp@0 292 Varlist = [Varlist,' srdatafile'];
tp@0 293 end
tp@0 294 if exist('calcpaths')
tp@0 295 Varlist = [Varlist,' calcpaths'];
tp@0 296 end
tp@0 297 if exist('calcirs')
tp@0 298 Varlist = [Varlist,' calcirs'];
tp@0 299 end
tp@0 300
tp@0 301 %---------------------------------------------------------------------------------------------
tp@0 302 % Find source and receiver coordinates either in the setup-file or in the CAD-file
tp@0 303
tp@0 304 [nsou,nsoucols] = size(sources);
tp@0 305 if nsoucols < 3
tp@0 306 if isempty(cadgeofiletoopen)
tp@0 307 error(['ERROR: sources should be taken from the CAD file, but no cadgeofile was specified as input parameter to EDB1readsetup'])
tp@0 308 end
tp@0 309 eval(['load ',cadgeofiletoopen])
tp@0 310 [n1,n2] = size(Snames);
tp@0 311 Snames = reshape(Snames.',1,n1*n2);
tp@0 312 strpos = zeros(nsou,1);
tp@0 313 for ii = 1:nsou
tp@0 314 strpos_source = findstr(sources(ii,:),Snames);
tp@0 315 if ~isempty(strpos_source)
tp@0 316 strpos(ii) = strpos_source;
tp@0 317 else
tp@0 318 error(['ERROR: One of the sources could not be found in the CAD-file: ',sources(ii,:)])
tp@0 319 end
tp@0 320
tp@0 321 end
tp@0 322 if prod(strpos) == 0
tp@0 323 error('ERROR: One of the sources could not be found in the CAD-file')
tp@0 324 end
tp@0 325 sounumbers = floor(strpos/n2)+1;
tp@0 326 sources = Scoords(sounumbers,:);
tp@0 327 end
tp@0 328
tp@0 329 [nrec,nreccols] = size(receivers);
tp@0 330 if nreccols ~= 3
tp@0 331 if isempty(cadgeofiletoopen)
tp@0 332 error(['ERROR: receivers should be taken from the CAD file, but no cadgeofile was specified as input parameter to EDB1readsetup'])
tp@0 333 end
tp@0 334 eval(['load ',cadgeofiletoopen])
tp@0 335 strpos = zeros(nrec,1);
tp@0 336 for ii = 1:nrec
tp@0 337 strpos_rec = find(Rnumbers==receivers(ii));
tp@0 338 if ~isempty(strpos_rec)
tp@0 339 strpos(ii) = strpos_rec;
tp@0 340 else
tp@0 341 error(['ERROR: One of the receivers could not be found in the CAD-file: ',int2str(receivers(ii))])
tp@0 342 end
tp@0 343 end
tp@0 344 if prod(strpos) == 0
tp@0 345 error('ERROR: One of the receivers could not be found in the CAD-file')
tp@0 346 end
tp@0 347 receivers = Rcoords(strpos,:);
tp@0 348 else
tp@0 349 if nrec == 1
tp@0 350 if abs(round(receivers(1))) == receivers(1) & abs(round(receivers(2)))==receivers(2) & abs(round(receivers(3))) == receivers(3)
tp@0 351 if SHOWTEXT > 0
tp@0 352 disp(['WARNING: You have specified the receivers as a row of three integer values, which is ambiguous'])
tp@0 353 disp([' It is interpreted as one receiver, with given coordinates'])
tp@0 354 end
tp@0 355 end
tp@0 356 end
tp@0 357 end
tp@0 358
tp@0 359 %---------------------------------------------------------------------------------------------
tp@0 360 % Check the optional parameters nSbatches etc
tp@0 361
tp@0 362 nsources = size(sources,1);
tp@0 363 nreceivers = size(receivers,1);
tp@0 364
tp@0 365 if exist('soulist_for_findpaths') ~= 1
tp@0 366 soulist_for_findpaths = [1:nsources];
tp@0 367 else
tp@0 368 if soulist_for_findpaths(1) < 1
tp@0 369 error('ERROR: soulist_for_findpaths must start with an integer > 0')
tp@0 370 end
tp@0 371 if soulist_for_findpaths(end) > nsources
tp@0 372 error('ERROR: soulist_for_findpaths must end with an integer <= the number of sources')
tp@0 373 end
tp@0 374 end
tp@0 375 if exist('reclist_for_findpaths') ~= 1
tp@0 376 reclist_for_findpaths = [1:nreceivers];
tp@0 377 else
tp@0 378 if reclist_for_findpaths(1) < 1
tp@0 379 error('ERROR: reclist_for_findpaths must start with an integer > 0')
tp@0 380 end
tp@0 381 if reclist_for_findpaths(end) > nreceivers
tp@0 382 error('ERROR: reclist_for_findpaths must end with an integer <= the number of receivers')
tp@0 383 end
tp@0 384 end
tp@0 385 if exist('soulist_for_calcirs') ~= 1
tp@0 386 soulist_for_calcirs = [1:nsources];
tp@0 387 else
tp@0 388 if soulist_for_calcirs(1) < 1
tp@0 389 error('ERROR: soulist_for_calcirs must start with an integer > 0')
tp@0 390 end
tp@0 391 if soulist_for_calcirs(end) > nsources
tp@0 392 error('ERROR: soulist_for_calcirs must end with an integer <= the number of sources')
tp@0 393 end
tp@0 394 end
tp@0 395 if exist('reclist_for_calcirs') ~= 1
tp@0 396 reclist_for_calcirs = [1:nreceivers];
tp@0 397 else
tp@0 398 if reclist_for_calcirs(1) < 1
tp@0 399 error('ERROR: reclist_for_calcirs must start with an integer > 0')
tp@0 400 end
tp@0 401 if reclist_for_calcirs(end) > nreceivers
tp@0 402 error('ERROR: reclist_for_calcirs must end with an integer <= the number of receivers')
tp@0 403 end
tp@0 404 end
tp@0 405
tp@0 406 Varlist = [Varlist,' soulist_for_findpaths reclist_for_findpaths soulist_for_calcirs reclist_for_calcirs'];
tp@0 407
tp@0 408 %---------------------------------------------------------------------
tp@0 409 % Optional parameters for batch processing
tp@0 410
tp@0 411 eval(['load ',cadgeofiletoopen])
tp@0 412 batchsize = 6000;
tp@0 413
tp@0 414 suggestednSbatches = ceil(size(planecorners,1)*size(sources,1)/batchsize);
tp@0 415 suggestednRbatches = ceil(size(planecorners,1)*size(receivers,1)/batchsize);
tp@0 416
tp@0 417 if exist('nRbatches') ~= 1
tp@0 418 if suggestednRbatches > 1
tp@0 419 disp(['WARNING!!! The number of planes and receivers is high enough that it is recommended'])
tp@0 420 disp([' to set nRbatches to ',int2str(suggestednRbatches)])
tp@0 421 disp([' Set SHOWTEXT to 0 or 1 to skip the pause'])
tp@0 422 if SHOWTEXT > 1
tp@0 423 disp(['Take the chance to stop the processing and change the value of nRbatches'])
tp@0 424 pause
tp@0 425 end
tp@0 426
tp@0 427 else
tp@0 428 nRbatches = 1;
tp@0 429 end
tp@0 430 else
tp@0 431 if nRbatches < 0,
tp@0 432 error('ERROR: The parameter nRbatches must be a positive integer')
tp@0 433 else
tp@0 434 if suggestednRbatches > nRbatches
tp@0 435 disp(['WARNING!!! The number of planes and receivers is high enough that it is recommended'])
tp@0 436 disp([' to set nRbatches to ',int2str(suggestednRbatches)])
tp@0 437 disp([' Set SHOWTEXT to 0 or 1 to skip the pause'])
tp@0 438 if SHOWTEXT > 1
tp@0 439 disp(['Take the chance to stop the processing and change the value of nRbatches'])
tp@0 440 pause
tp@0 441 end
tp@0 442 else
tp@0 443 nRbatches = round(nRbatches);
tp@0 444 end
tp@0 445 end
tp@0 446 end
tp@0 447 if exist('nSbatches') ~= 1
tp@0 448 if suggestednSbatches > 1
tp@0 449 disp(['WARNING!!! The number of planes and sources is high enough that it is recommended'])
tp@0 450 disp([' to set nSbatches to ',int2str(suggestednSbatches)])
tp@0 451 disp([' Set SHOWTEXT to 0 or 1 to skip the pause'])
tp@0 452 if SHOWTEXT > 1
tp@0 453 disp(['Take the chance to stop the processing and change the value of nSbatches'])
tp@0 454 pause
tp@0 455 end
tp@0 456 else
tp@0 457 nSbatches = 1;
tp@0 458 end
tp@0 459 else
tp@0 460 if nSbatches < 0,
tp@0 461 error('ERROR: The parameter nSbatches must be a positive integer')
tp@0 462 else
tp@0 463 if suggestednSbatches > nSbatches
tp@0 464 disp(['WARNING!!! The number of planes and sources is high enough that it is recommended'])
tp@0 465 disp([' to set nSbatches to ',int2str(suggestednSbatches)])
tp@0 466 disp([' Set SHOWTEXT to 0 or 1 to skip the pause'])
tp@0 467 if SHOWTEXT > 1
tp@0 468 disp(['Take the chance to stop the processing and change the value of nSbatches'])
tp@0 469 pause
tp@0 470 end
tp@0 471 else
tp@0 472 nSbatches = round(nSbatches);
tp@0 473 end
tp@0 474 end
tp@0 475 end
tp@0 476
tp@0 477 Varlist = [Varlist,' nSbatches nRbatches'];
tp@0 478
tp@0 479 %---------------------------------------------------------------------
tp@0 480 % Optional parameters for path editing
tp@0 481
tp@0 482 if exist('symmetricedgepairs') ~= 1
tp@0 483 symmetricedgepairs = [];
tp@0 484 else
tp@0 485 if size(symmetricedgepairs,2) ~= 2,
tp@0 486 error('ERROR: The matrix symmetricedgepairs must have two columns')
tp@0 487 end
tp@0 488 end
tp@0 489
tp@0 490 Varlist = [Varlist,' symmetricedgepairs'];
tp@0 491
tp@0 492 %---------------------------------------------------------------------
tp@0 493 % Save in the output file
tp@0 494
tp@0 495 setupmatfile = [Filepath,Filestem,'_setup.mat'];
tp@0 496
tp@0 497 eval(['save ',setupmatfile,Varlist])