pathToFolder = './Site';
files = dir( fullfile(pathToFolder,'*.dat') );
data = cell(numel(files),1);
index = 'g s m d o f a h i j'
for i=1:numel(files)
fid = fopen([pathToFolder '/site' num2str(i) 'index' '.dat'], 'rt');
H = textscan(fid, '%s', 21, 'Delimiter','\n');
C = textscan(fid, repmat('%f ',1,8), 'Delimiter',' ', ...
'MultipleDelimsAsOne',true, 'CollectOutput',true);
fclose(fid);
H = H{1}; C = C{1};
1 Comment
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/419916-how-to-read-file-with-name-consist-of-number-and-string#comment_612407
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/419916-how-to-read-file-with-name-consist-of-number-and-string#comment_612407
Sign in to comment.