Define periods using symbol

this is a stupid question that may have a quick answer. in deterministic simulations, when defining the sequence of shocks, for example you can define a sequence of exogenous parameter changes, path = [1;2;3], and write
periods 1:3;
values (A);

that works fine. what if i want to define the number of periods as a symbol, say span=3, and let periods go from 1 to the span value, while changing span as you will. i tried 1:(span) and 1:(‘span’), neither seems to work, dynare says it must be an integer. how should i write it? thanks a lot.

I think this is not possible yet as the preprocessor does not accept this syntax. Is there a particular reason why you would need such a feature?

thank you. we want to compare simulation results between quarterly and annual setup. if we let for example TFP (call it A) increase over time from 0.8 to 1, i can make it happen over 20 years or 80 quarters, and define “span” as the number of periods. i would write the code like this:

span = 20(or 80);
pathA = linspace(0.8,1,span)’;

var A;
periods 1:“span”;
values (pathgamma);

is there no way to do it even with matlab commands? thanks.

You might be able to do it with the Macro language of the preprocessor. But for your case it seems quicker to do it manually. If you have to do it more often, just add both commands and comment one of them out.

it’s not a big deal i was just wondering if there is something i was missing from the manual. thanks a lot!