Opening many excel files into different matrices

4 vues (au cours des 30 derniers jours)
Konstantinos Belivanis
Konstantinos Belivanis le 24 Sep 2014
Réponse apportée : Iain le 24 Sep 2014
Hello all,
I have a large amount of excel files containing many rows and columns (different each time). I would like to load each file as a matrix with an ascending index in MATLAB. Till now, the only thing I have figured out is to create a big zero 3D matrix and filling it up.
The unfortunate event with this method is that I end up with many zeros that I don't want as all the z-direction matrices need to be of the same size.
Any idea?
Thanks a lot in advance!
  1 commentaire
Pierre Benoit
Pierre Benoit le 24 Sep 2014
Have you try using cell arrays ?

Connectez-vous pour commenter.

Réponse acceptée

Iain
Iain le 24 Sep 2014
A cell array would be ideal. Example:
list = {'file1.xls','C:\data\file2.xls', ....};
for i = 1:numel(list)
data{i} = xlsread(list{i});
plot(data{i}(:,1),data{i}(:,1)); hold all
end

Plus de réponses (0)

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by