Beg for help: Levin's code for Ramsey policy

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Beg for help: Levin's code for Ramsey policy

Postby huangjing2122 » Sat Mar 03, 2012 7:56 am

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!
Attachments
Get_Ramsey.zip
(22.52 KiB) Downloaded 89 times
Bestsw.mod
(11.35 KiB) Downloaded 86 times
huangjing2122
 
Posts: 3
Joined: Tue Feb 28, 2012 1:00 am

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

Postby psd » Mon Sep 15, 2014 7:07 pm

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
psd
 
Posts: 2
Joined: Tue Mar 22, 2011 10:50 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 11 guests