dynare fname.mod

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

dynare fname.mod

Postby xuyongdeng » Mon Aug 10, 2015 9:17 pm

Hi all, I have a very simple question about using dynare fname.mod. For example, I have several mod files named as "rbc.mod, NK.mod,sw.mod,.....". I define fname='rbc' for example. And then I want to run dynare fname.mod. I get errors. Is there any way to do this?
My idea is just changing fname at begging. I can then make use of fname_dynamic.m and also fname_results.mat in later programmes.
Thanks in advance.
xuyongdeng
 
Posts: 13
Joined: Mon Aug 10, 2015 9:08 pm

Re: dynare fname.mod

Postby jpfeifer » Tue Aug 11, 2015 6:32 am

Could you please explain what you are trying to do? Usually, you call rbc.mod with
Code: Select all
dynare rbc
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: dynare fname.mod

Postby xuyongdeng » Tue Aug 11, 2015 9:53 am

Thanks for your reply. I don't want to run dynare rbc.mod directly. My codes is

fname='rbc'
dynare fname.mod.

I have a function, where fname is inpute, I'll make use the dynare results as output (i.e.oo_,M_).
xuyongdeng
 
Posts: 13
Joined: Mon Aug 10, 2015 9:08 pm

Re: dynare fname.mod

Postby jpfeifer » Tue Aug 11, 2015 9:55 am

In that case, you should use the eval command of Matlab:

Code: Select all
eval(['dynare ',fname,'.mod'])
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: dynare fname.mod

Postby xuyongdeng » Tue Aug 11, 2015 10:36 am

It works. Thank you very much.
xuyongdeng
 
Posts: 13
Joined: Mon Aug 10, 2015 9:08 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests