An example function for reading files in a loop from a directory.
- out = loopfilereadr(mydir,extension)
The output is a structure array containing one file per elemnt. The "reader" function is xclreadr. The input is a directory and optional file extension. This function is written to work for CSV files containing one row of "variable" labels and one column "sample" labels. It is meant as a template for writing custom file reading within a loop. See comments in the code below for examples of changing "readers" and output argument.
Example of file contents:
,columnLabel_1,columnLabel_2,columnLabel_3 rowLabel_1,1,2,3 rowLabel_2,4,5,6 rowLabel_3,7,8,9
- mydir : directory (folder) to search, only searches single directory, no subdirectories.
- extension : file extension to specify (optional).
- out : structure array with one dataset per element.