When collecting data, I've currently named my files in the following format:
Where the number before the underscore is a continent:
1- Africa 2- South America 3- Central America
The second number is the day in that continent the measurement was made on. What I'd like to do is to add the country the measurements were made in onto the end of the filename as well. For example:
1_1 --> 1_10 I want to rename each one to
1_1_Zaire --> 1_10_Zaire
1_11 --> 1_14, I want to rename each one to
1_11_Kenya --> 1_11_Kenya
How could I do this while keeping all the .mat files in the same folder? I'd prefer to use MATLAB for the renaming if possible.
I understand the algorithm will be something like the following:
- name a directory with all the .mat files
- make a for loop from bound 1 to bound x
- concatenate the phrase I want
The only problem is, I don't know how to get the length of the loop, and I don't understand how MATLAB reads files in a directory.