dm = readtable('iris.csv');
% find and remove rows where target is missing
target_missing = ismissing(dm{:, "species"});
dm(target_missing,:)=[]

% all variables other than species are features
varnames = dm.Properties.VariableNames;
prednames = varnames(~strcmpi(varnames, "species"));

% read predictor feature values into matrix X
X = dm{:, prednames}

% find means of across dimension 1, omit missing values

m = mean(X, 1, 'omitmissing');
sd = std (X, 1, 'omitmissing');

% find the indices of non-numbers (empty cells)
missing = isnan(X(:,:));
[r, c] = find(missing);    % get row "r", and column "c" 
for i = 1:length(r)
    X(r(i), c(i)) = m(c(i));
end
