95 lines
4.4 KiB
HTML
95 lines
4.4 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||
|
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Description of datatomfile</title>
|
||
|
<meta name="keywords" content="datatomfile">
|
||
|
<meta name="description" content="Copyright (C) 2001 Michel Juillard">
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||
|
<meta name="generator" content="m2html © 2003 Guillaume Flandin">
|
||
|
<meta name="robots" content="index, follow">
|
||
|
<link type="text/css" rel="stylesheet" href="../m2html.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<a name="_top"></a>
|
||
|
<div><a href="../index.html">Home</a> > <a href="index.html">.</a> > datatomfile.m</div>
|
||
|
|
||
|
<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td>
|
||
|
<td align="right"><a href="index.html">Index for . <img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
|
||
|
|
||
|
<h1>datatomfile
|
||
|
</h1>
|
||
|
|
||
|
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="box"><strong>Copyright (C) 2001 Michel Juillard</strong></div>
|
||
|
|
||
|
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="box"><strong>function datatomfile (s,var_list) </strong></div>
|
||
|
|
||
|
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="fragment"><pre class="comment"> Copyright (C) 2001 Michel Juillard
|
||
|
|
||
|
DYNATYPE : DYNATYPE ( [ 'filename' ] )
|
||
|
This optional command saves the simulation
|
||
|
results in a text file. The name of each
|
||
|
variable preceeds the corresponding results.
|
||
|
This command must follow SIMUL.</pre></div>
|
||
|
|
||
|
<!-- crossreference -->
|
||
|
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
This function calls:
|
||
|
<ul style="list-style-image:url(../matlabicon.gif)">
|
||
|
</ul>
|
||
|
This function is called by:
|
||
|
<ul style="list-style-image:url(../matlabicon.gif)">
|
||
|
</ul>
|
||
|
<!-- crossreference -->
|
||
|
|
||
|
|
||
|
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
|
||
|
<div class="fragment"><pre>0001 <span class="comment">% Copyright (C) 2001 Michel Juillard</span>
|
||
|
0002 <span class="comment">%</span>
|
||
|
0003 <a name="_sub0" href="#_subfunctions" class="code">function datatomfile (s,var_list)</a>
|
||
|
0004 <span class="comment">% DYNATYPE : DYNATYPE ( [ 'filename' ] )</span>
|
||
|
0005 <span class="comment">% This optional command saves the simulation</span>
|
||
|
0006 <span class="comment">% results in a text file. The name of each</span>
|
||
|
0007 <span class="comment">% variable preceeds the corresponding results.</span>
|
||
|
0008 <span class="comment">% This command must follow SIMUL.</span>
|
||
|
0009
|
||
|
0010 <span class="keyword">global</span> M_ oo_
|
||
|
0011
|
||
|
0012 <span class="comment">%fid=fopen([s,'.m'],'w') ;</span>
|
||
|
0013 sm=[s,<span class="string">'.m'</span>];
|
||
|
0014 fid=fopen(sm,<span class="string">'w'</span>) ;
|
||
|
0015
|
||
|
0016 n = size(var_list,1);
|
||
|
0017 <span class="keyword">if</span> n == 0
|
||
|
0018 n = M_.endo_nbr;
|
||
|
0019 ivar = [1:n]';
|
||
|
0020 var_list = M_.endo_names;
|
||
|
0021 <span class="keyword">else</span>
|
||
|
0022 ivar=zeros(n,1);
|
||
|
0023 <span class="keyword">for</span> i=1:n
|
||
|
0024 i_tmp = strmatch(var_list(i,:),M_.endo_names,<span class="string">'exact'</span>);
|
||
|
0025 <span class="keyword">if</span> isempty(i_tmp)
|
||
|
0026 error ([<span class="string">'One of the specified variables does not exist'</span>]) ;
|
||
|
0027 <span class="keyword">else</span>
|
||
|
0028 ivar(i) = i_tmp;
|
||
|
0029 <span class="keyword">end</span>
|
||
|
0030 <span class="keyword">end</span>
|
||
|
0031 <span class="keyword">end</span>
|
||
|
0032
|
||
|
0033
|
||
|
0034 <span class="keyword">for</span> i = 1:n
|
||
|
0035 fprintf(fid,[M_.endo_names(ivar(i),:), <span class="string">'=['</span>],<span class="string">'\n'</span>) ;
|
||
|
0036 fprintf(fid,<span class="string">'\n'</span>) ;
|
||
|
0037 fprintf(fid,<span class="string">'%15.8g\n'</span>,oo_.endo_simul(ivar(i),:)') ;
|
||
|
0038 fprintf(fid,<span class="string">'\n'</span>) ;
|
||
|
0039 fprintf(fid,<span class="string">'];\n'</span>) ;
|
||
|
0040 fprintf(fid,<span class="string">'\n'</span>) ;
|
||
|
0041 <span class="keyword">end</span>
|
||
|
0042 fclose(fid) ;
|
||
|
0043</pre></div>
|
||
|
<hr><address>Generated on Fri 16-Jun-2006 09:09:06 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address>
|
||
|
</body>
|
||
|
</html>
|