What does "files 132, 290, and 404" mean? Are these the indices in rightfiles, or are these parts of the file name?
rightfiles([132, 290, 404]) = ;
for z = 1:numel(rightfiles)
f = importdata(rightfiles(z).name);
I've added some changes:
- size(rightfield) replies a vector. 1:1:vector might reply something other than you expect. Although this works here for accident, it is safer to use numel instead.
- 1:x looks nicer than 1:1:x
- No need for square brackets around rightfiles(z).name. The [ and ] are the operator for concatenation. With one input only, there is nothing to concatenate.
Apply a pre-allocation before the loop. Letting arrays grow iteratively is extremely expensive.