%% Import data from spreadsheet
% Script for importing data from the following spreadsheet:
%
%    Workbook: C:\Users\Admin\Documents\Bakalářská práce\EXCEL_grafy_napeti_SK_vnitrni.xlsx
%    Worksheet: List1
%
% To extend the code for use with different selected data or a different
% spreadsheet, generate a function instead of a script.

% Auto-generated by MATLAB on 2018/03/19 20:29:55

%% Import the data
[~, ~, raw] = xlsread('C:\Users\Admin\Documents\Bakalářská práce\EXCEL_grafy_napeti_SK_vnitrni.xlsx','List1','A4:P211');
raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''};

%% Replace non-numeric cells with NaN
R = cellfun(@(x) ~isnumeric(x) && ~islogical(x),raw); % Find non-numeric cells
raw(R) = {NaN}; % Replace non-numeric cells

%% Create output variable
data = reshape([raw{:}],size(raw));

%% Allocate imported array to column variable names
xdlkask = data(:,1);
ynapt = data(:,2);
xdlkask1 = data(:,3);
ynapt1 = data(:,4);
xdlkask2 = data(:,5);
ynapt2 = data(:,6);
xdlkask3 = data(:,7);
ynapt3 = data(:,8);
xdlkask4 = data(:,9);
ynapt4 = data(:,10);
xdlkask5 = data(:,11);
ynapt5 = data(:,12);
xdlkask6 = data(:,13);
ynapt6 = data(:,14);
xdlkask7 = data(:,15);
ynapt7 = data(:,16);

%% Clear temporary variables
clearvars data raw R;