Home > . > dynasave.m

dynasave

PURPOSE ^

Copyright (C) 2001 Michel Juillard

SYNOPSIS ^

function dynasave(s,var_list)

DESCRIPTION ^

 Copyright (C) 2001 Michel Juillard

 DYNASAVE :    DYNASAVE ( [ 'filename' ] )    
        This optional command saves the simulation results
        in a .MAT file.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % Copyright (C) 2001 Michel Juillard
0002 %
0003 function dynasave(s,var_list)
0004 % DYNASAVE :    DYNASAVE ( [ 'filename' ] )
0005 %        This optional command saves the simulation results
0006 %        in a .MAT file.
0007 
0008   global M_ oo_
0009 
0010   n = size(var_list,1);
0011   if n == 0
0012     n = M_.endo_nbr;
0013     ivar = [1:n]';
0014     var_list = M_.endo_names;
0015   else
0016     ivar=zeros(n,1);
0017     for i=1:n
0018       i_tmp = strmatch(var_list(i,:),M_.endo_names,'exact');
0019       if isempty(i_tmp)
0020     error (['One of the specified variables does not exist']) ;
0021       else
0022     ivar(i) = i_tmp;
0023       end
0024     end
0025   end
0026 
0027 
0028 %  dyn2vec(var_list(1),var_list(1));
0029 eval([var_list(1) '=oo_.y_simul(ivar(1),:)'';'])
0030 eval(['save ' s ' ' var_list(1) ' -mat'])
0031   for i = 2:n
0032 %    dyn2vec(var_list(i),var_list(i));
0033     eval([var_list(i) '=oo_.y_simul(ivar(i),:)'';'])
0034     eval(['save ' s ' ' var_list(i) ' -append -mat'])
0035   end
0036 
0037

Generated on Fri 16-Jun-2006 09:09:06 by m2html © 2003