MATLAB Answers

0

How to apply function to certain files in directory

Asked by fernando aguirre on 16 Jul 2018
Latest activity Answered by Pawel Jastrzebski on 16 Jul 2018
I have a directory full of different files. The function I have will fopen and fread the content and process it to create other files. My function takes in parameter (parameter being the title of the file), but I would like to make the function run through the directory and read only the .raw files in that folder. Any help?

  0 Comments

Sign in to comment.

1 Answer

Answer by Pawel Jastrzebski on 16 Jul 2018
 Accepted Answer

Just get the function to work on the selected files in the folder to begin with:
i.e.
fileNames = dir('*.raw'); % structure
fileNames = {fileNames.name}; % actual names extracted to cell array

  0 Comments

Sign in to comment.