有没有办法阅读和打印我不知道全名的文件内容 例如:
myFile = fullfile(systemPath,'aeroD_*.txt')
% fileread ,textread doesn't work as the filename isn't complete
如何阅读/打印文件内容?
答案 0 :(得分:1)
使用dir
获取带有wildchars的所有可能文件名,然后打印每个文件
fls = dir( fullfile(systemPath,'aeroD_*.txt') );
for fi=1:numel( fls )
myFile = fullfile( systemPath, fls(fi).name ); % now name has no wildchars
% ... read the file
end