function [xdelkask,ynapeti,xdelkask1,ynapeti1,xdelkask2,ynapeti2,xdelkask3,ynapeti3,xdelkask4,ynapeti4,xdelkask5,ynapeti5,xdelkask6,ynapeti6,xdelkask7,ynapeti7] = importfile1(workbookFile,sheetName,startRow,endRow)
%IMPORTFILE1 Import data from a spreadsheet
%   [xdelkask,ynapeti,xdelkask1,ynapeti1,xdelkask2,ynapeti2,xdelkask3,ynapeti3,xdelkask4,ynapeti4,xdelkask5,ynapeti5,xdelkask6,ynapeti6,xdelkask7,ynapeti7]
%   = IMPORTFILE1(FILE) reads data from the first worksheet in the
%   Microsoft Excel spreadsheet file named FILE and returns the data as
%   column vectors.
%
%   [xdelkask,ynapeti,xdelkask1,ynapeti1,xdelkask2,ynapeti2,xdelkask3,ynapeti3,xdelkask4,ynapeti4,xdelkask5,ynapeti5,xdelkask6,ynapeti6,xdelkask7,ynapeti7]
%   = IMPORTFILE1(FILE,SHEET) reads from the specified worksheet.
%
%   [xdelkask,ynapeti,xdelkask1,ynapeti1,xdelkask2,ynapeti2,xdelkask3,ynapeti3,xdelkask4,ynapeti4,xdelkask5,ynapeti5,xdelkask6,ynapeti6,xdelkask7,ynapeti7]
%   = IMPORTFILE1(FILE,SHEET,STARTROW,ENDROW) reads from the specified
%   worksheet for the specified row interval(s). Specify STARTROW and
%   ENDROW as a pair of scalars or vectors of matching size for
%   dis-contiguous row intervals. To read to the end of the file specify an
%   ENDROW of inf.
%
%	Non-numeric cells are replaced with: NaN
%
% Example:
%   [xdelkask,ynapeti,xdelkask1,ynapeti1,xdelkask2,ynapeti2,xdelkask3,ynapeti3,xdelkask4,ynapeti4,xdelkask5,ynapeti5,xdelkask6,ynapeti6,xdelkask7,ynapeti7] = importfile1('EXCEL_grafy_napeti_SK_vnejsi.xlsx','List1',4,214);
%
%   See also XLSREAD.

% Auto-generated by MATLAB on 2018/03/19 21:26:17

%% Input handling

% If no sheet is specified, read first sheet
if nargin == 1 || isempty(sheetName)
    sheetName = 1;
end

% If row start and end points are not specified, define defaults
if nargin <= 3
    startRow = 4;
    endRow = 214;
end

%% Import the data
[~, ~, raw] = xlsread(workbookFile, sheetName, sprintf('A%d:P%d',startRow(1),endRow(1)));
for block=2:length(startRow)
    [~, ~, tmpRawBlock] = xlsread(workbookFile, sheetName, sprintf('A%d:P%d',startRow(block),endRow(block)));
    raw = [raw;tmpRawBlock]; %#ok<AGROW>
end
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
I = cellfun(@(x) ischar(x), raw);
raw(I) = {NaN};
data = reshape([raw{:}],size(raw));

%% Allocate imported array to column variable names
xdelkask = data(:,1);
ynapeti = data(:,2);
xdelkask1 = data(:,3);
ynapeti1 = data(:,4);
xdelkask2 = data(:,5);
ynapeti2 = data(:,6);
xdelkask3 = data(:,7);
ynapeti3 = data(:,8);
xdelkask4 = data(:,9);
ynapeti4 = data(:,10);
xdelkask5 = data(:,11);
ynapeti5 = data(:,12);
xdelkask6 = data(:,13);
ynapeti6 = data(:,14);
xdelkask7 = data(:,15);
ynapeti7 = data(:,16);

