Not recognizing any text files in folder using dir(fullfile)
I am trying to plot data from multiple text csv files in a folder. This is the first part of my code:
folder_path = ‘C:userspowerdownloadsstar capillary files’; % Replace with your folder path
% List all TXT files in the folder
txt_files = dir(fullfile(folder_path, ‘*.txt’));
for file_idx = 1:length(txt_files)
filename = fullfile(folder_path, txt_files(file_idx).name);
% Load the TXT file
data = readtable(filename, ‘Delimiter’, ‘,’);
Matlab is not recognizing that there are text files in my folder, though there are. I wrote a similar code to make calculations from a single txt file in that folder and it works. Does anyone know why it might not be recognizing txt files with this code? I added the folder to path in the matlab software by right clicking. Any help would be extremely appreciated!I am trying to plot data from multiple text csv files in a folder. This is the first part of my code:
folder_path = ‘C:userspowerdownloadsstar capillary files’; % Replace with your folder path
% List all TXT files in the folder
txt_files = dir(fullfile(folder_path, ‘*.txt’));
for file_idx = 1:length(txt_files)
filename = fullfile(folder_path, txt_files(file_idx).name);
% Load the TXT file
data = readtable(filename, ‘Delimiter’, ‘,’);
Matlab is not recognizing that there are text files in my folder, though there are. I wrote a similar code to make calculations from a single txt file in that folder and it works. Does anyone know why it might not be recognizing txt files with this code? I added the folder to path in the matlab software by right clicking. Any help would be extremely appreciated! I am trying to plot data from multiple text csv files in a folder. This is the first part of my code:
folder_path = ‘C:userspowerdownloadsstar capillary files’; % Replace with your folder path
% List all TXT files in the folder
txt_files = dir(fullfile(folder_path, ‘*.txt’));
for file_idx = 1:length(txt_files)
filename = fullfile(folder_path, txt_files(file_idx).name);
% Load the TXT file
data = readtable(filename, ‘Delimiter’, ‘,’);
Matlab is not recognizing that there are text files in my folder, though there are. I wrote a similar code to make calculations from a single txt file in that folder and it works. Does anyone know why it might not be recognizing txt files with this code? I added the folder to path in the matlab software by right clicking. Any help would be extremely appreciated! text file MATLAB Answers — New Questions