Creating a structure array containing names of external files

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 个评论

You mean something similar to the dir function?
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

请先登录,再进行评论。

 采纳的回答

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.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by