Expression or statement is incorrect--possibly unbalanced (,

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.

Expression or statement is incorrect--possibly unbalanced (,

Postby rwhitt01 » Thu May 28, 2015 8:48 pm

Hello,

I have the following errors:

Error: File: gc_ov2.m Line: 280 Column: 89
Expression or statement is incorrect--possibly unbalanced (, {, or [.

Error in dynare (line 180)
evalin('base',fname) ;

I cannot figure out how to resolve this problem. I have reinstalled dynare but no luck.
Any help would be greatly appreciated.

Regards,
Richard

Matab version: R2014a
Dynare version: 4.4.3

Matlab output:


>> dynare gc_ov2

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Starting Dynare (version 4.4.3).
Starting preprocessing of the model file ...
WARNING: gc_ov2.mod:11.12-15.5: Symbol rho declared twice.
Found 19 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.

Error: File: gc_ov2.m Line: 280 Column: 89
Expression or statement is incorrect--possibly unbalanced (, {, or [.

Error in dynare (line 180)
evalin('base',fname) ;
Attachments
gc_ov2.mod
(20.87 KiB) Downloaded 126 times
rwhitt01
 
Posts: 23
Joined: Tue Nov 11, 2014 5:50 pm

Re: Expression or statement is incorrect--possibly unbalance

Postby jpfeifer » Fri May 29, 2015 3:03 pm

Outside of the model block, you cannot have line breaks in equations like
Code: Select all
mc_a_foreign = -(((2 - alpha2 + (alpha1 + alpha2)*comOpenness)*(alpha2*(1 - comOpenness)
               + alpha1*comOpenness + alpha1*comOpenness*phi + alpha2*(1 - comOpenness)*zeta))
               / (1 - alpha2 + alpha2*(1 - comOpenness) + alpha1*comOpenness + (alpha1 + alpha2)*comOpenness)^2);

Matlab will interpret this as separate statements. The line that starts with the divide then leads to the crash.
------------
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


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 8 guests