function [xpolomer,ynapeti,xpolomer1,ynapeti1,xpolomer2,ynapeti2,xpolomer3,ynapeti3,xpolomer4,ynapeti4,xpolomer5,ynapeti5,xpolomer6,ynapeti6,xpolomer7,ynapeti7] = importfile5(workbookFile,sheetName,startRow,endRow)
%IMPORTFILE1 Import data from a spreadsheet
%   [xpolomer,ynapeti,xpolomer1,ynapeti1,xpolomer2,ynapeti2,xpolomer3,ynapeti3,xpolomer4,ynapeti4,xpolomer5,ynapeti5,xpolomer6,ynapeti6,xpolomer7,ynapeti7]
%   = IMPORTFILE1(FILE) reads data from the first worksheet in the
%   Microsoft Excel spreadsheet file named FILE and returns the data as
%   column vectors.
%
%   [xpolomer,ynapeti,xpolomer1,ynapeti1,xpolomer2,ynapeti2,xpolomer3,ynapeti3,xpolomer4,ynapeti4,xpolomer5,ynapeti5,xpolomer6,ynapeti6,xpolomer7,ynapeti7]
%   = IMPORTFILE1(FILE,SHEET) reads from the specified worksheet.
%
%   [xpolomer,ynapeti,xpolomer1,ynapeti1,xpolomer2,ynapeti2,xpolomer3,ynapeti3,xpolomer4,ynapeti4,xpolomer5,ynapeti5,xpolomer6,ynapeti6,xpolomer7,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:
%   [xpolomer,ynapeti,xpolomer1,ynapeti1,xpolomer2,ynapeti2,xpolomer3,ynapeti3,xpolomer4,ynapeti4,xpolomer5,ynapeti5,xpolomer6,ynapeti6,xpolomer7,ynapeti7] = importfile1('EXCEL_grafy_napeti_deska_vnejsi.xlsx','List1',4,221);
%
%   See also XLSREAD.

% Auto-generated by MATLAB on 2018/03/21 13:54:27

%% 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 = 221;
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
xpolomer = data(:,1);
ynapeti = data(:,2);
xpolomer1 = data(:,3);
ynapeti1 = data(:,4);
xpolomer2 = data(:,5);
ynapeti2 = data(:,6);
xpolomer3 = data(:,7);
ynapeti3 = data(:,8);
xpolomer4 = data(:,9);
ynapeti4 = data(:,10);
xpolomer5 = data(:,11);
ynapeti5 = data(:,12);
xpolomer6 = data(:,13);
ynapeti6 = data(:,14);
xpolomer7 = data(:,15);
ynapeti7 = data(:,16);

