필터 지우기
필터 지우기

Creating a structure array containing names of external files

조회 수: 1 (최근 30일)
LINDO MTSWENI
LINDO MTSWENI 2019년 5월 1일
답변: Bob Thompson 2019년 5월 1일
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
Rik
Rik 2019년 5월 1일
You mean something similar to the dir function?
LINDO MTSWENI
LINDO MTSWENI 2019년 5월 1일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Bob Thompson
Bob Thompson 2019년 5월 1일
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개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by