function [xpolomr,ynapt,xpolomr1,ynapt1,xpolomr2,ynapt2,xpolomr3,ynapt3,xpolomr4,ynapt4,xpolomr5,ynapt5,xpolomr6,ynapt6,xpolomr7,ynapt7] = importfile4(workbookFile,sheetName,startRow,endRow)
%IMPORTFILE1 Import data from a spreadsheet
%   [xpolomr,ynapt,xpolomr1,ynapt1,xpolomr2,ynapt2,xpolomr3,ynapt3,xpolomr4,ynapt4,xpolomr5,ynapt5,xpolomr6,ynapt6,xpolomr7,ynapt7]
%   = IMPORTFILE1(FILE) reads data from the first worksheet in the
%   Microsoft Excel spreadsheet file named FILE and returns the data as
%   column vectors.
%
%   [xpolomr,ynapt,xpolomr1,ynapt1,xpolomr2,ynapt2,xpolomr3,ynapt3,xpolomr4,ynapt4,xpolomr5,ynapt5,xpolomr6,ynapt6,xpolomr7,ynapt7]
%   = IMPORTFILE1(FILE,SHEET) reads from the specified worksheet.
%
%   [xpolomr,ynapt,xpolomr1,ynapt1,xpolomr2,ynapt2,xpolomr3,ynapt3,xpolomr4,ynapt4,xpolomr5,ynapt5,xpolomr6,ynapt6,xpolomr7,ynapt7]
%   = 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:
%   [xpolomr,ynapt,xpolomr1,ynapt1,xpolomr2,ynapt2,xpolomr3,ynapt3,xpolomr4,ynapt4,xpolomr5,ynapt5,xpolomr6,ynapt6,xpolomr7,ynapt7] = importfile1('EXCEL_grafy_napeti_deska_vnitrni.xlsx','List1',4,221);
%
%   See also XLSREAD.

% Auto-generated by MATLAB on 2018/03/21 13:47:38

%% 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
xpolomr = data(:,1);
ynapt = data(:,2);
xpolomr1 = data(:,3);
ynapt1 = data(:,4);
xpolomr2 = data(:,5);
ynapt2 = data(:,6);
xpolomr3 = data(:,7);
ynapt3 = data(:,8);
xpolomr4 = data(:,9);
ynapt4 = data(:,10);
xpolomr5 = data(:,11);
ynapt5 = data(:,12);
xpolomr6 = data(:,13);
ynapt6 = data(:,14);
xpolomr7 = data(:,15);
ynapt7 = data(:,16);

