%% Read Variables from Spreadsheet File
% Import columns from a spreadsheet file as separate variables in the workspace. First, preview the contents of the text file outages.csv and then read columns as separate variables.
% Preview the data in patients.xls. The file has 10 variables.

opts = detectImportOptions('patients.xls');
preview('patients.xls',opts)

% Import the first three columns as separate variables in the workspace.

[LastName,Gender,Age] = readvars('patients.xls');
whos  LastName Gender Age

% Copyright 2018 The MathWorks, Inc.