what does . and .. refer to

조회 수: 1 (최근 30일)
Matlab works
Matlab works 2020년 1월 26일
댓글: Image Analyst 2020년 1월 27일
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|strcmp(TrainFiles(i).name,'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images in the training database
name{Train_Number}=TrainFiles(i).name;
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 1월 26일
User completely changed the question. However, the revised question is valid in itself.

댓글을 달려면 로그인하십시오.

답변 (2개)

Image Analyst
Image Analyst 2020년 1월 26일
It's checking to make sure that the file is not the current folder (dot) or a link to the parent folder (dot dot).
  댓글 수: 3
Walter Roberson
Walter Roberson 2020년 1월 26일
I would use
allFileNames = fullfile(yourImageFolder, {fileStructure.name});
Image Analyst
Image Analyst 2020년 1월 27일
Yes. Or you could even use imDatastore().

댓글을 달려면 로그인하십시오.


Steven Lord
Steven Lord 2020년 1월 26일
For the operating systems on which MATLAB is supported, . refers to the current directory and .. the parent directory, as stated on this Wikipedia page.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by