Steady State helper function output as a vector into Dynare

Hi

I have a helper function that numerically calculates the steady state for two variables simultaneously. The output of this function is a 2x1 vector of the solution of the two variables.

When running the following I get the error “ERROR: dsge3.mod: line 153, cols 10-15: Symbol sol cannot take arguments.”

sol = fveq(.9/TM, 0.5 , ALPHA, BETA, DELTA, EPS, PHI, SIGMA, VARPHI, GAMMA, Zg, Zm, TM);
    ns = sol(1);
    Ns = sol(2);

The function is defined as

function [ns1, Ns1] = fveq(ns0, Ns0, ALPHA, BETA, DELTA, EPS, PHI, SIGMA, VARPHI, GAMMA, Zg, Zm, TM)

I would need to see the full files.

I managed to solve it by changing how my function outputs the variables. Now I use [ns Ns] = fun()

Dear icecat2005, I have a similar issue, and I would be interested to understand how you have written the system in the helper function.

function [ns1, Ns1] = fveq(ns0, Ns0, ALPHA, BETA, DELTA, EPS, PHI, SIGMA, VARPHI, GAMMA, Zg, Zm, TM)
???
end;

I tried with the fsolve, but adding the country code with the macro language that function is not working anymore.

The point was that you can only request scalar outputs. Thus, don’t return a vector but rather one output for each value.