I want to Load data from folder and then put them in different file name. I want to display each data directory in different variable, like file{j}='directory of file number j' to have file1='D:\​17L11\17L1​1_01.m' . How can I do this?

1 view (last 30 days)
originalpath = 'D:\17L11'; foldername = fullfile(originalpath); pth = genpath(foldername); pathTest = regexp([pth ';'],'(.*?);','tokens');
for k = 1:size(pathTest,2)-1 list{k} = dir([pathTest{1,k}{:} '\*.m']); end A = zeros(1,numel(list)); for i = 1:numel(list) if(~isempty(list{i})) temp = list{i}; for j = 1: numel(temp) disp((fullfile(temp(j).folder,temp(j).name))); end end end

Answers (0)

Categories

Find more on File Operations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!