i am getting an error that my output argument is not assigned during call of the function
조회 수: 1 (최근 30일)
이전 댓글 표시
this is my error
Output argument "imlabel" (and maybe others) not assigned during call to "get_im_label".
Error in demo_CURET (line 25)
[imlabel, impath] = get_im_label(imdir)
i have attached my code and its corresponding function with this. please tell me what to change. Thanks in advance
댓글 수: 0
답변 (1개)
Walter Roberson
2018년 10월 15일
That appears to be extracted from https://upslide.site/3-d47c7f818758ee192afc4aae9ab8dae15.html but I do not find an implementation for dir_bo() anywhere.
Your code only assigns at least one value to imlabel in the case that dir_bo(imdir) is not empty, and you find at least one .db file in directory names that dir_bo(imdir) returns.
댓글 수: 3
Walter Roberson
2018년 10월 15일
That dir_bo.m is technically incorrect, but probably you will not notice in practice... not unless you happen to be using some of the more obscure file systems.
More likely is that you are not finding any .db files in the designated locations.
Try this:
info = dir( fullfile(imdir, '**', '*.db') );
filesnames = {info.name};
fprintf('Number of db files found: %d\n', length(filenames));
Walter Roberson
2018년 10월 15일
Corrected version of dir_bo:
function imname = dir_bo(datadir)
% written by Liefeng Bo in University of Washington on 01/04/2011
% corrected by Walter Roberson on 20161015
% - some filesystems do not have the . or .. entries at all
% - NTFS makes no promises about the order of file system entries
% - in practice, NTFS sorts by 16 bit Unicode, which sorts
% filenames beginning with any of ' !"#$%&'()*+,-' before '.'
% - if the details of how Apple sorts filenames do not bewilder
% you, then *please* publish a technical memo explaining them
% - in practice, all current Apple filesystems sort
% filenames beginning with any of ' !"#$%&'()*+,-' before '.'
% The main difference from NTFS in this matter is that some of
% those characters are illegal in NTFS filenames but valid on Apple
% remove rootdir
imname = dir(datadir);
mask = ismember({imname.name}, {'.', '..'});
imname(mask) = [];
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!