Page 1 of 1

Beg for help: Levin's code for Ramsey policy

PostPosted: Sat Mar 03, 2012 7:56 am
by huangjing2122
When running Levin's code with his example "Bestsw.mod", I use Dynare v3 and Matlab 2010b.

I type in command Window

>> infilename='Bestsw';
>> outfilename='Bestsw_OUT';
>> get_ramsey


It gives the following error:


??? Undefined function or method 'struct2cell' for input arguments of type 'sym'.

Error in ==> get_ramsey at 119
lmss_coefdefs{icoefdef} = ['lmss_vec(',num2str(iev),') = ',char(struct2cell(tmpval)),';'];


I don't know how to fix it. I'm begging for your help!

Re: Beg for help: Levin's code for Ramsey policy

PostPosted: Mon Sep 15, 2014 7:07 pm
by psd
Hi,
I ran into exactly the same problem today. The reason that you get the error message is due to the function struct2cell, which is not included in my (and your) version of matlab.
Luckily you don't need it to run get_ramsey. The way I fixed it is as follows: remove the command "struct2cell" at each line it appears in the get_ramsey.m file, this should work for you as well.
Best,
Pelin Ilbas