![]() Assuming that you are using Dynare 4.3.0, copy the example model file "c:\dynare\4.3.0\examples\example1.mod" to your working directory.Create a working directory that will hold your Dynare models.This file will usually be called "c:\Documents and Settings\USERNAME\.octaverc" on Windows XP and "c:\Users\USERNAME\.octaverc" on Windows Vista/7. If you don't want to type this command every time you run Octave, you can put it in a file called ".octaverc" in your home directory. Apply the setting by clicking "Save" button.Īt the Octave command prompt, type the following, replacing 4.x.y with your Dynare version.For example, if you have installed Dynare 4.3.0 in the standard location, select: Select the "matlab" subdirectory of you Dynare installation.You will only have to do this once as MATLAB will remember the setting next time you run it. Configuring MATLAB using the menu entries If you have installed Dynare in a non-standard directory, adjust the path accordingly. Type the following, replacing 4.x.y with your Dynare version.įor example, for Dynare 4.3.0 type: addpath c:\dynare\ 4.3.0\matlab.You will have to do this every time you start MATLAB, as MATLAB will not remember the setting. Configuring MATLAB using the Command Window You can either use the command window or the menu entries. Run Octave by locating it in the Windows start menu or on the desktop and by clicking on its icon.Double-click on the Octave installer and follow the instructions.Download the Octave installer at the Octave download page (make sure to pick the Octave version corresponding to the Dynare Windows installer).Run MATLAB by locating it in the Windows start menu and by clicking on its icon.Double-click on the Dynare installer and follow the instructions.Download the latest Dynare Windows installer at the Download page.Make sure that MATLAB is installed on your computer.It should be kept in mind that there is a gradation of expertise among the users of matlab, and in some cases less "advanced" and seemingly sloppy programming techniques can in fact be construed as advantageous in the short term (if not the long term, or where version and directory structure management might become problematic).To run Dynare, you have the choice between running it inside GNU Octave (free software) or MathWorks MATLAB (proprietary). There should however be room for such usage in what is a language that is frequently used for quick-and-dirty scripting. Notably, addpath is not more complicated to use, but now I seem to have a real reason to prefer cd: it's actually faster.Īs a postscript to this post I plead mea culpa to perverse use of cd (and in this example, addpath). at end of file mkdir ('matlab/myfiles') addpath ('matlab/myfiles','-end') 3. ![]() at top of file mkdir ('matlab/myfiles') addpath ('matlab/myfiles') savepath matlab/myfiles/pathdef.m2 2. While it may be considered sloppy, I have used cd for many years and while the slowdown can be appreciable if used repeatedly, I find that if it is not used in highly iterated parts of a program the slowdown is worth the simplicity it brings to coding. addpath () basically used for adding folders to search path. Then I ran either addpath or cd as follows: ticĪny comments on whether there are conditions under which use of cd might be justified, for instance to set the path to a function (toolbox or otherwise), are appreciated. Prior to each trial I cleared the workspace and created a string array with alternating paths: clear Then I decided to clock the performance of cd versus addpath and was surprised to find the following result. Given the fervent criticism I received I must imagine that there are very good reasons for using the path tools, presumably they are in some way more robust, especially when code is distributed to other systems. One of my answers was recently downvoted for suggesting use of cd(path_to_toolbox) rather than one of the path tools, such as addpath or rmpath.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |