Changeset 495 for trunk/src


Ignore:
Timestamp:
Jul 20, 2012, 1:44:19 AM (12 years ago)
Author:
sommeria
Message:

option 'background' set for matlab function in civ and series under windows OS

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r494 r495  
    15341534                                    return
    15351535                                end
    1536                                     %%% TODO FOR WINDOWS : TRANSLATE
    1537                                     %%% COMMANDS BELOW
    1538 %                                 fprintf(fid,['#!/bin/bash \n' ...
    1539 %                                     '/etc/sysprofile \n'...
    1540 %                                     'matlab -nodisplay -nosplash -nojvm <<END_MATLAB \n'...
    1541 %                                     'addpath(''' path_civ ''');\n']);
    1542 %                                 for p=1:length(batch_file_list)
    1543 %                                     fprintf(fid,['run ' batch_file_list{p} '\n']);
    1544 %                                 end
    1545 %                                 fprintf(fid, 'exit \n END_MATLAB \n');
     1536                                 fprintf(fid,['matlab -automation '...
     1537                                     '-r "addpath(''' regexprep(path_civ,'\\','\\\\') ''');']);
     1538                                for p=1:length(batch_file_list)
     1539                                    fprintf(fid,['run ' regexprep(batch_file_list{p},'\\','\\\\') ';']);
     1540                                end
     1541                                 fprintf(fid, 'exit"');
    15461542                                fclose(fid);
    1547 %                                 system(['chmod +x ' filename_superbat]);
    1548 %                                 system([filename_superbat ' &']);
    1549                             case {'GLNX86','GLNXA64','MACI64'}
     1543                                dos([filename_superbat ' &']);
     1544                            case {'GLNX86','GLNXA64','MACI64'}
    15501545                                filename_superbat=fullfile(RootBat,'job_list.sh');
    15511546                                fid=fopen(filename_superbat,'w');
  • trunk/src/series.m

    r494 r495  
    14051405            path_fct=get(handles.ActionPath,'String');
    14061406            filelog=regexprep(filexml,'.xml$','.log');
    1407             text_matlabscript=[...
    1408                 '#!/bin/bash \n'...
    1409                 '. /etc/sysprofile \n'...
    1410                 'matlab -nodisplay -nosplash -nojvm -logfile ''' filelog ''' <<END_MATLAB \n'...
    1411                 'addpath(''' path_uvmat '''); \n'...
    1412                 'addpath(''' Series.Action.ActionPath '''); \n'...
    1413                 '' Series.Action.ActionName  '( ''' filexml '''); \n'...
    1414                 'exit \n'...
    1415                 'END_MATLAB \n'];
    1416             fprintf(fid,text_matlabscript);
    1417             fclose(fid);
    1418             if isunix
    1419                 system(['chmod +x ' filename_bat]);% set the file to executable
    1420                 system(['. ' filename_bat ' &']);%execute fct
    1421             else
    1422                 system(filename_bat);
     1407       
     1408            switch computer
     1409                case {'GLNX86','GLNXA64','MACI64'}
     1410                    text_matlabscript=[...
     1411                        '#!/bin/bash \n'...
     1412                        '. /etc/sysprofile \n'...
     1413                        'matlab -nodisplay -nosplash -nojvm -logfile ''' filelog ''' <<END_MATLAB \n'...
     1414                        'addpath(''' path_uvmat '''); \n'...
     1415                        'addpath(''' Series.Action.ActionPath '''); \n'...
     1416                        '' Series.Action.ActionName  '( ''' filexml '''); \n'...
     1417                        'exit \n'...
     1418                        'END_MATLAB \n'];
     1419                    fprintf(fid,text_matlabscript);
     1420                    fclose(fid);
     1421                    system(['chmod +x ' filename_bat]);% set the file to executable
     1422                    system(['. ' filename_bat ' &']);%execute fct
     1423                   
     1424                case {'PCWIN','PCWIN64'}
     1425                    text_matlabscript=['matlab -automation -logfile ' regexprep(filelog,'\\','\\\\')...
     1426                        ' -r "addpath(''' regexprep(path_uvmat,'\\','\\\\') ''');'...
     1427                        'addpath(''' regexprep(Series.Action.ActionPath,'\\','\\\\') ''');'...
     1428                        '' Series.Action.ActionName  '( ''' regexprep(filexml,'\\','\\\\') ''');exit"'];
     1429                    fprintf(fid,text_matlabscript);
     1430                    fclose(fid);
     1431                    dos([filename_bat ' &']);
    14231432            end
    14241433        end
Note: See TracChangeset for help on using the changeset viewer.