I am trying to use evalc to retrieve a file from a folder filled with files.
I have multiple files that are named as follows:
If I do
then I am able to get every single file in this folder. However I only want to output files which end with 1957_008_data.csv
Therefore, if I do
- this works for me.
The issue is: this folder has files for different years (1957 and others) and different codes (008 and others), so I want a way to somehow be able to use evalc to get files where the user selects the pick_year and pick_code. For example the following will give 1957_008_data.csv as output but I don't know how to use eval with this. Could someone help me with the syntax of how to use the following in evalc. Thank you. Su
[num2str(pick_year) '_' num2str(pick_code) '_data.csv']