Error using randi
First input must be a positive scalar integer value IMAX, or two integer values [IMIN IMAX] with IMIN less than or
equal to IMAX.
Error in tt (line 25)
thisfile = files(randi(num_files)).name;
clc;
clear all;
tic;
id_test = 0;
id_train = 0;
for folder_idx = 1 : 10
for i = 1 : 8
files = dir( fullfile('ROITrain', num2str(folder_idx), [num2str(i) '.bmp ']));
num_files = numel(files);
thisfile = files(randi(num_files)).name;
B = imread(thisfile );
X = double(B);
X = imresize(X,[300 250],'bilinear');
id_train = id_train+1;
traindata{id_train}=ext_vein(X,1);
traindata = traindata';
reduced_traindata = cellfun(@(M) M(1:min(end,4), :), traindata, 'uniform', 0);
end
end
save('db2.mat','reduced_traindata');
toc
Best Answer