for i = 1:D Xtr = arrayfun(@(x) binarize(x, threshold), Xtrn(:, i));endXtrn is a MxD matrixXtr is a MxD matrix
Can we vectorize this loop as well?
This is what binarize does
function X = binarize(X, threshold) if(X<threshold) X = 0; else X = 1; endend
Best Answer