MATLAB Answers


How to extract data from multiple excel files

Asked by Simon Mendum on 13 Aug 2019
Latest activity Answered by Samatha Aleti on 19 Aug 2019
I am attempting to create a 3D map of 101 sets of data, each set is in a seperate excel spreadsheet, all sets are within 1 folder.
My MatLAB knowledge is minimal, but this is my attempt at the code:
filenamePrefix='F1--Trace-no loop-0000--0000';
for i = 1:nFiles
filename = [filenamePrefix, int2str(i), filenameExtension];
tmpData = readmatrix(filename, 'NumHeaderLines',1)
Please give any advice or alternative codes that could work

  1 Comment

on 13 Aug 2019
"create a 3D map of 101 sets of data, "
Can you explain precisely what the end result wanted is and what the data are/how they relate to the desired result?
As to alternatives, I'd probably start with something like--
d=dir('F1--Trace-no loop-0000--0000*.csv'); % return all files
for i=numel(d)
tmpData = readmatrix(d(i).name, 'NumHeaderLines',1);
It's what's next that depends on what it is wanting to do with the data and what it is that the data are.

Sign in to comment.

1 Answer

Answer by Samatha Aleti on 19 Aug 2019

You may find the relevant answer here


Sign in to comment.