Effacer les filtres
Effacer les filtres

Creating a structure array containing names of external files

1 vue (au cours des 30 derniers jours)
LINDO MTSWENI
LINDO MTSWENI le 1 Mai 2019
Good day , how can I create a function that will receive a structure array containing the names of the external files that will be read in separate field ?
  2 commentaires
Rik
Rik le 1 Mai 2019
You mean something similar to the dir function?
LINDO MTSWENI
LINDO MTSWENI le 1 Mai 2019
I think so because I have 3 external files that have to be received by the main function in a structure array format ,they will be used in the sub-functions

Connectez-vous pour commenter.

Réponse acceptée

Bob Thompson
Bob Thompson le 1 Mai 2019
As Rik mentioned, it sounds like dir is what you want.
files = dir(path);
This will return a structure called 'files' which contains the names of all files in the path location (and other information). To call the specific file you want just do files(index).name.

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by