Hot answers tagged

4

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) = ...


3

Here is my approach to assign a set of parameters to a macroeconcomic model: function para=assign_parameters(v) if length(v)==3 para.alpha=v(1); para.beta=v(2); para.gamma=v(3); else error('parameter input has not correct format of length 3!'); end The advantage is that the parameter set can be changed on the fly. That is, one can assign to the ...


2

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: function [exch]=achange(p,coins) s=size(coins); c=zeros(1,s(2)); coins=sort(coins,'descend'); it=1:s(2); isaninteger = @(x)isfinite(x) & x==floor(x); if p<coins(end) ...


Only top voted, non community-wiki answers of a minimum length are eligible