How to import multiple .mat files to workspace?
Show older comments
Hi,
As cited above, I'm trying to import multiple .mat files (total 72 no. of .mat files) which are at the location as in the code below. However the code doesn't import the files to the workspace and throws error as below.
files = dir('D:\Rahul\Data_tokamak\data&plot\data_paper1\H-mode data\H-mode bistable model\set1_neoAno_ratio_10\beta0.01\Contourplot\*.mat');
for i=1:length(files)
load(files(i).name,'-ascii');
end
ERROR:
Error using load
with regards,
rc
Accepted Answer
More Answers (1)
Paul
on 28 Apr 2024
0 votes
Why use the -ascii option to load a .mat file? If that's not the problem, please edit your question by copy/pasting the entire error message.
Depending on what's in the .mat files and how you're planning to process the data, you might want to consider using the output argument of load so that the data from each .mat file is stored in an element of an indexable array.
Categories
Find more on Large Files and Big Data 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!