Read names of files listed as entries in an excel file and run those files using a loop
I am trying to create a script that reads an excel file that has a column of names of .dat files that I want to process in matlab. I am having issues getting the script to read text entries in the excel file and having the script run those files. I know its a type issue, but I am not sure how to fix it.
This is my relevant code:
file_contents = readmatrix(‘testing_summary(Sheet1).csv’)
file_names = file_contents(1:12,3) % stores the names of the files
for i = 1:13(file_names)
fid = fopen(file_names(i));
fclose(fid); % Close the file when done
endI am trying to create a script that reads an excel file that has a column of names of .dat files that I want to process in matlab. I am having issues getting the script to read text entries in the excel file and having the script run those files. I know its a type issue, but I am not sure how to fix it.
This is my relevant code:
file_contents = readmatrix(‘testing_summary(Sheet1).csv’)
file_names = file_contents(1:12,3) % stores the names of the files
for i = 1:13(file_names)
fid = fopen(file_names(i));
fclose(fid); % Close the file when done
end I am trying to create a script that reads an excel file that has a column of names of .dat files that I want to process in matlab. I am having issues getting the script to read text entries in the excel file and having the script run those files. I know its a type issue, but I am not sure how to fix it.
This is my relevant code:
file_contents = readmatrix(‘testing_summary(Sheet1).csv’)
file_names = file_contents(1:12,3) % stores the names of the files
for i = 1:13(file_names)
fid = fopen(file_names(i));
fclose(fid); % Close the file when done
end read text entries in excel, run several files using a for loop MATLAB Answers — New Questions