How to put all the element in multidimesional array?
1 次查看(过去 30 天)
显示 更早的评论
Mohamad Khairul Ikhwan Zulkarnain
2018-7-10
评论: Mohamad Khairul Ikhwan Zulkarnain
2018-7-11
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
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?
采纳的回答
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
2018-7-11
All files data is stored in the cell array iwant. You can access the data using iwant{i}
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!