Home > matlab > writedata_text.m

writedata_text

PURPOSE ^

function writedata(fname)

SYNOPSIS ^

function writedata_text(fname)

DESCRIPTION ^

 function writedata(fname)
 store endogenous and exogenous variables in a text file 
 INPUT
   fname: name of the text file
 OUTPUT
   none
 ALGORITHM
   none
 SPECIAL REQUIREMENT
   none

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function writedata_text(fname)
0002 % function writedata(fname)
0003 % store endogenous and exogenous variables in a text file
0004 % INPUT
0005 %   fname: name of the text file
0006 % OUTPUT
0007 %   none
0008 % ALGORITHM
0009 %   none
0010 % SPECIAL REQUIREMENT
0011 %   none
0012 
0013 % Copyright (C) 2007-2009 Dynare Team
0014 %
0015 % This file is part of Dynare.
0016 %
0017 % Dynare is free software: you can redistribute it and/or modify
0018 % it under the terms of the GNU General Public License as published by
0019 % the Free Software Foundation, either version 3 of the License, or
0020 % (at your option) any later version.
0021 %
0022 % Dynare is distributed in the hope that it will be useful,
0023 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0024 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0025 % GNU General Public License for more details.
0026 %
0027 % You should have received a copy of the GNU General Public License
0028 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0029 
0030 global M_ oo_
0031 S=[fname '_endo.dat'];
0032 fid = fopen(S,'w');
0033 for i = 1:size(M_.endo_names,1)
0034     fprintf(fid,'%s ',M_.endo_names(i,:)');
0035 end;
0036 fprintf(fid,'\n');
0037 for i = 1:size(oo_.endo_simul,2)
0038     fprintf(fid,'%15.7f ',oo_.endo_simul(:,i));
0039     fprintf(fid,'\n');
0040 end
0041 fclose(fid);
0042 
0043 S=[fname '_exo.dat'];
0044 fid = fopen(S,'w');
0045 for i = 1:size(M_.exo_names,1)
0046     fprintf(fid,'%s ',M_.exo_names(i,:));
0047 end;
0048 fprintf(fid,'\n');
0049 for i = 1:size(oo_.exo_simul,1)
0050     fprintf(fid,'%15.7f ',oo_.exo_simul(i,:));
0051     fprintf(fid,'\n');
0052 end
0053 fclose(fid);
0054 return;

Generated on Wed 23-May-2012 02:40:54 by m2html © 2005