what does . and .. refer to

1 visualizzazione (ultimi 30 giorni)
Matlab works
Matlab works il 26 Gen 2020
Commentato: Image Analyst il 27 Gen 2020
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 Commento
Walter Roberson
Walter Roberson il 26 Gen 2020
User completely changed the question. However, the revised question is valid in itself.

Accedi per commentare.

Risposte (2)

Image Analyst
Image Analyst il 26 Gen 2020
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 Commenti
Walter Roberson
Walter Roberson il 26 Gen 2020
I would use
allFileNames = fullfile(yourImageFolder, {fileStructure.name});
Image Analyst
Image Analyst il 27 Gen 2020
Yes. Or you could even use imDatastore().

Accedi per commentare.


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

Categorie

Scopri di più su File Operations in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by