% Importing XLSX via MATLAB Wizard
% This script demonstrates a few approaches to import
% an XLSX file via the Wizard.

k_cleanup();
k_unitsPreferenceActivate('mm_N_s');
% k_unitsVariables('mm, MPa, GPa, G')
adv = k_adv();

%#ok<*NOPTS>

%% Import via Wizard as Numeric Matrix & Create a k_units array

% After using the MATLAB Data Import Wizard with settings for Numeric 
% Matrix importing, we create our k_units variable as shown below.
% Note: the numeric data was imported into the variable "tensionTest"

raw_1 = k_units(tensionTest, 'sec, N, mm', ...
    'ColNames', 'Time, Load, Ext', ...
    'Descrip', 'Tension Test');

raw_1  % This will echo the variable to command window
k_varViewer(raw_1) % Explore in Kornucopia variable viewer


%% Import via Wizard as Matlab Table & Create a k_units array

% After using the MATLAB Data Import Wizard with settings for Numeric 
% Matrix importing, we create our k_units variable as shown below.
% Note: the numeric data was imported into the variable "tensionTest_T"

raw_2 = k_units(tensionTest_T{:,:}, 'sec, N, mm', ...
    'ColNames', tensionTest_T.Properties.VariableNames, ...
    'Descrip', 'Tension Test');

check = isequal(raw_1, raw_2)
