Since, I was urged to present an answer for didactic reasons to which I totally agree, I will provide the full set of corrections to avoid any ambiguity.
% Model parameters
alpha = 1/3; %
s = 0.2; % Investment rate
delta = 0.2; % Depreciation rate
n = 0.02; % Growth of labor force
g = 0.01; % technological progress
eps = 1;
k(1) = ...
Here is my approach to assign a set of parameters to a macroeconcomic model:
error('parameter input has not correct format of length 3!');
The advantage is that the parameter set can be changed on the fly. That is, one can assign to the ...
I thought a little bit about the problem, and I came up with the following quick hack, that seems to work.
Here is the piece of code that should do the job in principle with integers:
isaninteger = @(x)isfinite(x) & x==floor(x);