MATLAB: Load in all files of a folder fileloadopen Hi, I have a lot of folders containing .csv files. Is there a way to load in all possible files without given a specific command to the file? Best Answer Use dir to generate a file list (you can use to search a folder tree), then use a loop to process all files one by one. Related SolutionsMATLAB: Open many files using uiopen or uigetfile filename = uigetfile('*.*', 'All Files (*.*)','MultiSelect','on'); MATLAB: How to load a excel file in folder You can run a loop for all the (excel/csv) files in the folder. Go through the below lines of code:xlfiles = dir('*.csv'); % You are in the folder of csv files/ change extension accordingly Nfiles = length(xlfiles) ; % number of files% loop for each file for i = 1:Nfiles fname = xlfiles(i).name ; % file name data = xlsread(fname) ; % read the file %%do what you want %%%end Related QuestionFiles with specific extensionHow to load a .mat file from the parent directoryHow to get all file extentions from a folderLoad a file by using a string in which the filename is storedHow do i read all the files in a folderHow to show all images of a folder
Best Answer