Matlab Continue Equation Output on Next Line

[ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

4.23 Macro-processing language

It is possible to use "macro" commands in the '.mod' file for doing the following tasks: including modular source files, replicating blocks of equations through loops, conditionally executing some code, writing indexed sums or products inside equations…

The Dynare macro-language provides a new set of macro-commands which can be inserted inside '.mod' files. It features:

  • file inclusion
  • loops (for structure)
  • conditional inclusion (if/then/else structures)
  • expression substitution

Technically, this macro language is totally independent of the basic Dynare language, and is processed by a separate component of the Dynare pre-processor. The macro processor transforms a '.mod' file with macros into a '.mod' file without macros (doing expansions/inclusions), and then feeds it to the Dynare parser. The key point to understand is that the macro-processor only does text substitution (like the C preprocessor or the PHP language). Note that it is possible to see the output of the macro-processor by using the savemacro option of the dynare command (see section Dynare invocation).

The macro-processor is invoked by placing macro directives in the '.mod' file. Directives begin with an at-sign followed by a pound sign (@#). They produce no output, but give instructions to the macro-processor. In most cases, directives occupy exactly one line of text. In case of need, two anti-slashes (\\) at the end of the line indicates that the directive is continued on the next line. The main directives are:

  • @#includepath, paths to search for files that are to be included,
  • @#include, for file inclusion,
  • @#define, for defining a macro-processor variable,
  • @#if, @#ifdef, @#ifndef, @#else, @

0 Response to "Matlab Continue Equation Output on Next Line"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel