dir(cd)

3 visualizzazioni (ultimi 30 giorni)
Ani Asoyan
Ani Asoyan il 18 Feb 2020
Commentato: Stephen23 il 28 Lug 2023
What does dir(cd) stand for?
files = dir(cd);
  1 Commento
Stephen23
Stephen23 il 28 Lug 2023
Note that the simpler approach call only one function, not two:
files = dir('.');

Accedi per commentare.

Risposta accettata

Cristian Garcia Milan
Cristian Garcia Milan il 22 Mag 2020
dir is a function that takes a look in a determined folder (and subfolder if you command).
cd without arguments is your actual location
dir(cd) would bring you all the files in your actual location.
files = dir(cd);
Will return a struct with name of the file, folder,a boolean value about if it is a folder or not, and its modification date.
Hope it helps!

Più risposte (0)

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