Skip to content

Instantly share code, notes, and snippets.

@ajfigueroa
Created April 16, 2014 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajfigueroa/10918288 to your computer and use it in GitHub Desktop.
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.
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