How to put all the element in multidimesional array?

1 回表示 (過去 30 日間)
Mohamad Khairul Ikhwan Zulkarnain
Mohamad Khairul Ikhwan Zulkarnain 2018 年 7 月 10 日
I have around 118 chemical element and I would like to put it in multidimesional array to make it easier for me to choose which one I would like to use. I will attached all the textfile that I would like to put in the array. Thank you in advance!
  2 件のコメント
Sri Harish G
Sri Harish G 2018 年 7 月 10 日
Could you please specify how you want the elements to be arranged in the multidimensional array and what are the dimensions of the array you want to arrange these elements in?
Mohamad Khairul Ikhwan Zulkarnain
Mohamad Khairul Ikhwan Zulkarnain 2018 年 7 月 10 日
What do you mean how you want the elements to be arrange in the multidimensional array? The dimension will be 3 dimension I think.

サインインしてコメントする。

採用された回答

KSSV
KSSV 2018 年 7 月 10 日
files = dir('*txt') ; % you are in the folder with text files
N = length(files) ;
names = {files(:).name}' ;
iwant = cell(N,1) ;
for i = 1:N
iwant{i} = importdata(files(i).name) ;
end
  8 件のコメント
KSSV
KSSV 2018 年 7 月 11 日
All files data is stored in the cell array iwant. You can access the data using iwant{i}
Mohamad Khairul Ikhwan Zulkarnain
Mohamad Khairul Ikhwan Zulkarnain 2018 年 7 月 11 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by