Changeset 20292


Ignore:
Timestamp:
03/03/16 18:12:00 (9 years ago)
Author:
Eric.Larour
Message:

CHG: fixed writejscellarray routine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/js/writejscellarray.m

    r20254 r20292  
    55                fprintf(fid,'%s=%g;\n',prefix,cell);
    66        else
    7                 if length(cell),
    8                         if length(cell)==1,
    9                                 fprintf(fid,'%s=[''%s''];\n',prefix,cell{1});
    10                         else
    11                                 fprintf(fid,'%s=[''%s'',',prefix,cell{1});
    12                                 for i=2:length(cell)-1,
    13                                         fprintf(fid,'''%s'',',cell{i});
    14                                 end
    15                                 fprintf(fid,'''%s''];\n',cell{end});
     7                fprintf(fid,'%s=[',prefix);
     8                for i=1:length(cell),
     9                        array=cell{i};
     10                        fprintf(fid,'[');
     11                        for j=1:length(array)-1,
     12                                fprintf(fid,'%g,',array(j));
    1613                        end
    17                 else
    18                         fprintf(fid,'%s=[];\n',prefix);
     14                        fprintf(fid,'%g]',array(end));
     15                        if i<length(cell), fprintf(fid,','); end
    1916                end
     17                fprintf(fid,'];\n');
    2018        end
    2119
     20
    2221end
Note: See TracChangeset for help on using the changeset viewer.