%matrix_function.m
%
%Used when past expectations are present
%
%This program uses the strings A_j,B_j,C_j,F_j,G_j, and it_name to
%construct MATLAB anonymous functions for calculations involving
%A_j,B_j,C_j,F_j and G_j for any j
%
%THIS VERSION: 0.1 October 30, 2007
%
%Copyright: Alexander Meyer-Gohde
%
%You are free to use/modify/redistribute this program so long as original
%authorship credit is given and you in no way impinge on its free
%distribution
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for matj=[65,66,67,70,71]
eval(sprintf('eval([''target=%s_j;''])',char(matj)))
eval(sprintf('eval([''%s_j=@(%s)%s;''])',char(matj),it_name,target))
end
请高手指点迷津:红色部分的代码为什么错了?怎样修改?
Error in ==> ..\linlagex\matrix_function.m
On line 23 ==> eval(sprintf('eval([''%s_j=@(%s)%s;''])',char(matj),it_name,target))
这是matlab的提示。
M文件在附件中。
我要对货币政策的模型进行数值模拟。模型中要求解前瞻性变量,我找到求解的代码(这仅仅是求解文件中的一个),但是运行的时候总是出错。我对matlab了解不是很多,但是这些模型深刻而完美地体现了经济运行规律,我必须对它们求解。技术问题,一个难关,很是头痛。
为了使问题更加清楚,我把求解程序包附上,而且附上一个例子。请高手告诉我,究竟什么地方出错啊? 怎样改正?