For those who want to quickly have something running, this page explains how to
setup Dynare on Windows or macOS and to run your first
model (`.mod`

) file.

To run Dynare, you have the choice between running it on MathWorks MATLAB (proprietary) or GNU Octave (free software).

# Windows

## Using Dynare with MATLAB

- Make sure that MATLAB is installed on your computer.
- Download and install the latest Dynare package
- Open MATLAB
- Configure MATLAB for Dynare (see the section below)
- Run a Dynare example in MATLAB (see the section below)

## Using Dynare with Octave

- Download and install the Octave installer
- Download and install the latest Dynare package
- Open Octave
- Configure Octave for Dynare (see the section below)
- Run a Dynare example in Octave (see the section below)

## Configuring MATLAB for Dynare on Windows

You have two choices. You can either use the command window or the menu entries.

### 1. Configuring MATLAB using the Command Window on Windows

You will have to do this every time you start MATLAB, as MATLAB will not remember the setting.

- Click on the “Command Window”
- If you have Dynare installed in the standard location, type the following, replacing
`4.x.y`

with your Dynare version:`>> addpath C:\dynare\4.x.y\matlab`

For example, for Dynare 4.5.7 type:

`>> addpath C:\dynare\4.5.7\matlab`

### 2. Configuring MATLAB using the menu entries on Windows

You will only have to do this once as MATLAB will remember the setting the next time you run it.

- On the MATLAB
`Home`

tab, in the`Environment`

section, click on`Set Path`

- Click
`Add Folder...`

.**Warning: DO NOT**select`Add with Subfolders...`

- Select the
`matlab`

subdirectory of your Dynare installation. For example, if you have installed Dynare 4.5.7 in the standard location, select:`C:\dynare\4.5.7\matlab`

- Apply the setting by clicking
`Save`

button

## Configuring Octave for Dynare on Windows

If you have Dynare installed in the standard location type the following at the Octave command prompt, replacing `4.x.y`

with your Dynare version:
Windows

```
>> addpath C:\dynare\4.x.y\matlab
```

For example, for Dynare 4.5.7 type:

```
>> addpath C:\dynare\4.5.7\matlab
```

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. This file will usually be called `C:\Users\USERNAME\.octaverc`

.

## Running and editing a Dynare example on Windows

- Create a working directory that will hold your Dynare models. For example,
`C:\dynare\work`

. - Assuming that you are using Dynare 4.5.7, copy the example model file
`C:\dynare\4.5.7\examples\example1.mod`

to your working directory. - At the MATLAB or Octave command prompt, type the following to change the working directory:
`>> cd C:\dynare\work`

- Then type the following to run the example model file:
`>> dynare example1`

- You can edit the example by typing:
`>> edit example1.mod`

# macOS

## Using Dynare with MATLAB

- Make sure that MATLAB is installed on your computer.
- Download and install the latest Dynare package
- Open MATLAB
- Configure MATLAB for Dynare (see the section below)
- Run a Dynare example in MATLAB (see the section below)

## Using Dynare with Octave

- Download and install Homebrew following the instructions on their site
- Install Octave and Dynare via Homebrew
- Open Terminal (
`Applications->Utilities->Terminal`

) - At the terminal prompt, type:
`brew update && brew upgrade && brew install dynare`

- Open Terminal (
- Open Octave
- Open Terminal (
`Applications->Utilities->Terminal`

) - At the terminal prompt, type:
`octave`

- Open Terminal (
- Configure Octave for Dynare (see the section below)
- Run a Dynare example in Octave (see the section below)

## Configuring MATLAB for Dynare on macOS

You have two choices. You can either use the command window or the menu entries.

### 1. Configuring MATLAB using the Command Window on macOS

You will have to do this every time you start MATLAB, as MATLAB will not remember the setting.

- Click on the “Command Window”
- If you have Dynare installed in the standard location, type the following, replacing
`4.x.y`

with your Dynare version:`>> addpath /Applications/Dynare/4.x.y/matlab`

For example, for Dynare 4.5.7 type:

`>> addpath /Applications/Dynare/4.5.7/matlab`

### 2. Configuring MATLAB using the menu entries on macOS

You will only have to do this once as MATLAB will remember the setting the next time you run it.

- On the MATLAB
`Home`

tab, in the`Environment`

section, click on`Set Path`

- Click
`Add Folder...`

.**Warning: DO NOT**select`Add with Subfolders...`

- Select the
`matlab`

subdirectory of your Dynare installation. For example, if you have installed Dynare 4.5.7 in the standard location, select:`/Applications/Dynare/4.5.7/matlab`

- Apply the setting by clicking
`Save`

button

## Configuring Octave for Dynare on macOS

If you have Dynare installed in the standard location type the following at the Octave command prompt, replacing `4.x.y`

with your Dynare version:

```
>> addpath /Applications/Dynare/4.x.y/matlab
```

For example, for Dynare 4.5.7 type:

```
>> addpath /Applications/Dynare/4.5.7/matlab
```

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. This file will usually
be called `/home/USERNAME/.octaverc`

.

## Running and editing a Dynare example on macOS

- Create a working directory that will hold your Dynare models. For example,
`/home/USERNAME/work`

. - Assuming that you are using Dynare 4.5.7, copy the example model file
`/Applications/Dynare/4.5.7/examples/example1.mod`

to your working directory. - At the MATLAB or Octave command prompt, type the following to change the working directory:
`>> cd /home/USERNAME/work`

- Then type the following to run the example model file:
`>> dynare example1`

- You can edit the example by typing:
`>> edit example1.mod`