Check the name of the data file in @dynSeries/save method (do not erase the original data file).
parent
28f3ca1d07
commit
f258ffbfbc
|
@ -28,7 +28,11 @@ end
|
|||
|
||||
switch format
|
||||
case 'm'
|
||||
if exist([basename, '.m'],'file')
|
||||
fid = fopen([basename, '.new', '.m'],'w');
|
||||
else
|
||||
fid = fopen([basename, '.m'],'w');
|
||||
end
|
||||
fprintf(fid,'%% File created on %s.\n',datestr(now));
|
||||
fprintf(fid,'\n');
|
||||
fprintf(fid,'FREQ__ = %s;\n',num2str(A.freq));
|
||||
|
@ -66,9 +70,18 @@ switch format
|
|||
str = [str, A.name{v} ' = A.data(:,' num2str(v) ');' ];
|
||||
end
|
||||
eval(str);
|
||||
if exist([basename, '.mat'],'file')
|
||||
save([basename '.new.mat'],'INIT__','FREQ__','NAMES__','TEX__',A.name{:});
|
||||
else
|
||||
save([basename '.mat'],'INIT__','FREQ__','NAMES__','TEX__',A.name{:});
|
||||
end
|
||||
|
||||
case 'csv'
|
||||
if exist([basename, '.csv'],'file')
|
||||
fid = fopen([basename, '.new', '.csv'],'w');
|
||||
else
|
||||
fid = fopen([basename, '.csv'],'w');
|
||||
end
|
||||
fprintf(fid,', %s', A.name{:});
|
||||
fprintf(fid,'\n');
|
||||
for t=1:A.nobs
|
||||
|
|
Loading…
Reference in New Issue