%% Import data from spreadsheet
% Script for importing data from the following spreadsheet:
%
%    Workbook: C:\dynare\6.0\examples\basetri.xlsx
%    Worksheet: Feuil1
%
% Auto-generated by MATLAB on 16-Jul-2024 10:21:02

%% Set up the Import Options and import the data
opts = spreadsheetImportOptions("NumVariables", 7);

% Specify sheet and range
opts.Sheet = "Feuil1";
opts.DataRange = "A2:G94";

% Specify column names and types
opts.VariableNames = ["zone", "PI", "C", "Y", "IG", "G", "Sm"];
opts.VariableTypes = ["categorical", "double", "double", "double", "double", "double", "double"];

% Specify variable properties
opts = setvaropts(opts, "zone", "EmptyFieldRule", "auto");

% Import the data
tbl = readtable("C:\dynare\6.0\examples\basetri.xlsx", opts, "UseExcel", false);

%% Convert to output type
zone = tbl.zone;
PI = tbl.PI;
C = tbl.C;
Y = tbl.Y;
IG = tbl.IG;
G = tbl.G;
Sm = tbl.Sm;

%% Clear temporary variables
clear opts tbl