


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


0001 function writedata(fname) 0002 % function writedata(fname) 0003 % store endogenous and exogenous variables in a XLS spreadsheet file 0004 % INPUT 0005 % fname: name of the XLS 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 0032 % xlswrite doesn't exist on Octave, and appeared in MATLAB 7.0 0033 if exist('OCTAVE_VERSION') || matlab_ver_less_than('7.0') 0034 error('Function not supported on your version of MATLAB or Octave') 0035 end 0036 0037 S=[fname '_endo.xls']; 0038 n=size(oo_.endo_simul,2); 0039 delete(S); 0040 S=upper(cellstr(M_.endo_names)); 0041 S1=cellstr([num2str((1:n)') char(65*ones(1,n))']); 0042 xlswrite([fname '_endo'], S', 'endogenous', 'B1'); 0043 xlswrite([fname '_endo'], S1, 'endogenous', 'A2'); 0044 xlswrite([fname '_endo'], oo_.endo_simul', 'endogenous', 'B2'); 0045 S=[fname '_exo.xls']; 0046 n=size(oo_.exo_simul,1); 0047 delete(S); 0048 S=upper(cellstr(M_.exo_names)); 0049 S1=cellstr([num2str((1:n)') char(65*ones(1,n))']); 0050 xlswrite([fname '_exo'], S','exogenous', 'B1'); 0051 xlswrite([fname '_exo'], S1, 'exogenous', 'A2'); 0052 xlswrite([fname '_exo'], oo_.exo_simul,'exogenous', 'B2');