while using for loop in following function some blank cells are come into output matrix like [ ] [ ] [ ]. I dont understand where i wrong in for loop
Afficher commentaires plus anciens
function build_db(ICount, JCount)
p=0;
path = 'E:\MATLAB\R2016b\bin\img\PCA\my_PhD_Programs\minuite\FVC2002\DB1_B\'
for i=1:ICount % 10
for j=1:JCount % 8
filename=[path,num2str(i) '_' num2str(j) '.bmp'];
img = imread(filename);
img = imresize(img,[374 388]);
p=p+1;
if ndims(img) == 3;
img = rgb2gray(img);
end % colour image
disp(['extracting features from ' filename ' ...']);
if j<4
testdata{p}=ext_vein(img,1);
else
traindata{p}=ext_vein(img,1);
end
end
end
save('db1.mat','testdata');
save('db2.mat','traindata');
end
%********************************************** Function invoked *******************
build_db(2,8); %THIS WILL TAKE ABOUT 30 MINUTES
load('db1.mat');
load('db2.mat');
testdata = testdata'; % Adjust matrix dimension
testfeature = cell2mat(testdata); % Convert cell array to matrix
traindata = traindata';
trainfeature = cell2mat(traindata);
dist = pdist2(testfeature,trainfeature,'euclidean'); % compute euclidian distance
%*****************************************OUTPUT We Get *********************************************** Testdata matrix contains following values
54x6 double
44x6 double
44x6 double
[]
[]
[]
[]
[]
44x6 double
60x6 double
38x6 double
and traindata contains following values
[]
[]
[]
50x6 double
47x6 double
38x6 double
31x6 double
43x6 double
[]
[]
[]
35x6 double
37x6 double
39x6 double
27x6 double
27x6 double
Réponse acceptée
Plus de réponses (1)
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!