dir(cd)

3 views (last 30 days)
Ani Asoyan
Ani Asoyan on 18 Feb 2020
Commented: Stephen23 on 28 Jul 2023
What does dir(cd) stand for?
files = dir(cd);
  1 Comment
Stephen23
Stephen23 on 28 Jul 2023
Note that the simpler approach call only one function, not two:
files = dir('.');

Sign in to comment.

Accepted Answer

Cristian Garcia Milan
Cristian Garcia Milan on 22 May 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!
  1 Comment
Ani Asoyan
Ani Asoyan on 26 May 2020
Thank you !

Sign in to comment.

More Answers (0)

Categories

Find more on File Operations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!