how to put '(xlsread) variable' in { } ?

9 vues (au cours des 30 derniers jours)
Dessa
Dessa le 24 Juin 2020
Commenté : Dessa le 25 Juin 2020
data1 = xlsread('~~~.xlsx');
data2 = xlsread('~~~.xlsx');
data3 = xlsread('~~~.xlsx');
d = {'data1','data2','data3'};
num_d = numel(d);
I want to load the .xls file. (at least one to three)
each of them would be named as data1,2,3.
what i want to do is put that variables in { }
ex) if i read one data by ' data1 = xlread('~~~.xls') ', there woluld be only 'data1' in d. so the num_d = 1 . and so on.
can i get some help?

Réponse acceptée

Image Analyst
Image Analyst le 24 Juin 2020
Modifié(e) : Image Analyst le 24 Juin 2020
Like this:
d = {data1, data2, data3};
If it's in a for loop, then do it like this
for k = 1 : 10
filename = whatever......
d{k} = xlsread(filename);
end
  1 commentaire
Dessa
Dessa le 25 Juin 2020
thanks it helps.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by