MATLAB: I have more than 100 mat files with data inside them. how to extract all the data inside the matlab file to the matlab workspace so that i can plot a graph with it ? Help me..

dataextractgraph plottingimportmatlab workspace

to

Best Answer

Simply load each mat file into a variable, then this task is easy:
S = dir('*.mat');
for k = 1:numel(S)
S(k).data = load(S(k).name);
end
You can then access the data of each element of S, e.g.: for the first file: if the file contains a variable XXX:
S(1).name % filename
S(1).data.XXX % file data XXX