Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Saving mutiple files as structs

1 回表示 (過去 30 日間)
Bobby Haynes
Bobby Haynes 2019 年 4 月 5 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi, I am using the 'uipickfiles' function to select multiple .txt files and want to get data from those multiple files but its saved as a cell. Is there a way I can save them as an array? I want the same structs that come with 'dir', however, 'cell2struct' is not giving me those values. Is there psuedocode someone can show me? Thanks!

回答 (1 件)

A. Sawas
A. Sawas 2019 年 4 月 6 日
Asuming you get the files in cell array called "files", you can run the following loop to build the struct array "s_files" you want:
s_files = dir(files{1});
for i=2:length(files)
s_files = [s_files; dir(files{i})];
end

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by