Problems importing data

Hi, I have had problem importing data to Dynare:
please see attached are my excel file and mat file,

  1. I used the code
    save usmodel_data a

to tranform the xls data file into mat file

  1. I used the :
    estimation(datafile=usmodel_data,mode_compute=4, mh_replic=0);

command to import data to Dynare, while the error message says:
Error using load_mat_file_data_legacy (line 30)
makedataset: The variable(s) dy, dc, dinve, labobs, pinfobs, dw, robs listed in varobs are not contained in the dataset

usmodel_data.mat (11.0 KB)
data.xls (58 KB)

Please could anyone help me with the issue?

That will not work. You are saving only one matrix named a into the data file that you load. But Dynare expects several vectors with the name of the individual data series. Is there a reason you do not lead the Excel-file directly?

no reason, please could you provide more details regarding how to import from excel directly?

You should be able to use


If necessary, also use the xls_range-option

1 Like

Hi prof, thanks for your reply,which has helped me resolve the issue.
Please could you help me with another question?
regarding the graphs produced by shock_decomposition command, the defaults uses different colours to differentiate different groups, is it possible to adapt it ( dashed, shaded, filled) to suit the black and white print?


Dynare does not provide such an option. You either need to recreate the graph you desire based on the results in oo_.shock_decomposition or you can use Matlab’s figure editor to change the graph Dynare produces.