1function c = options2cell(o)
2
3% Converts an option structure as a cell of NAME and VALUE pairs.
4%
5% INPUTS
6%  o o       matlab's structure holding a set of options (each field name is the name of an option and the associated content is the value of the option).
7%
8% OUTPUTS
9%  o c       matlab's cell row array of the form {NAME1, VALUE1, NAME2, VALUE2, NAME3, VALUE3, ...}.
10
11% Copyright (C) 2013-2017 Dynare Team.
12%
13% This file is part of Dynare.
14%
15% Dynare is free software: you can redistribute it and/or modify
16% it under the terms of the GNU General Public License as published by
17% the Free Software Foundation, either version 3 of the License, or
18% (at your option) any later version.
19%
20% Dynare is distributed in the hope that it will be useful,
21% but WITHOUT ANY WARRANTY; without even the implied warranty of
22% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23% GNU General Public License for more details.
24%
25% You should have received a copy of the GNU General Public License
26% along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
27
28s = fieldnames(o);
29c = {};
30j = 1;
31
32for i=1:length(s)
33    c(j) = {s{i}};
34    c(j+1) = {o.(s{i})};
35    j = j+2;
36end