Created
April 16, 2014 18:36
-
-
Save ajfigueroa/10918288 to your computer and use it in GitHub Desktop.
Method to read in file directory as a list of char arrays and it can be used to find certain files versus concatenating strings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clc; clear all; close all; | |
file_names = dir; | |
file_idx = 1; | |
desired_string = 'slice'; | |
for i = 1:length(file_names) | |
name = file_names(i).name; | |
if findstr(desired_string, name) | |
% Do stuff with name here. | |
file_idx = file_idx + 1; | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment