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

조회 수: 9 (최근 30일)
Dessa
Dessa 2020년 6월 24일
댓글: Dessa 2020년 6월 25일
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?

채택된 답변

Image Analyst
Image Analyst 2020년 6월 24일
편집: Image Analyst 2020년 6월 24일
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
Dessa
Dessa 2020년 6월 25일
thanks it helps.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by