function [SPD, HN, SZ] = importExcelSubNumbers(folder, filename) %% Import the data [~, ~, raw] = xlsread([folder, filename]); raw = raw(2: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 data = reshape([raw{:}],size(raw)); %% Allocate imported array to column variable names SPD = data(:,1); HN = data(:,2); SZ = data(:,3); %% Clear temporary variables clear data raw R;