I have a series of .mat files in the directories "Pos" and "Neg". Within each mat file, there are a series of variables, one of which is called "pval", which is a cell array. What I'd like to do is loop through each directory, open the mat files, and find out if any of the cells in pval is < 0.05. If it is, I'd like to transfer that entire mat file (with all the variables) to a new directory called Pos_Significant or Neg_Significant (depending on which root directory I am in). I'm having a little trouble figuring out how to do this.
Any help would be greatly appreciated!