フィルターのクリア

Import data from files into variable

2 ビュー (過去 30 日間)
theo
theo 2021 年 3 月 20 日
コメント済み: theo 2021 年 3 月 20 日
Hello, I could't store my imported data into single matrix. I have multiple file with text data inside it and want to compile all the data into one file.
Here is the code that i've tried. is there any way to make the S variable save the imported data without deleting the previous imported data?
clear all;
clc;
files=dir('*-*');
N=length(files);
for i=1:N
file=files(i).name;
S=importdata(file);
end

採用された回答

Walter Roberson
Walter Roberson 2021 年 3 月 20 日
clear all;
clc;
files=dir('*-*');
N=length(files);
S = cell(N,1);
for i=1:N
file=files(i).name;
S{i}=importdata(file);
end
  1 件のコメント
theo
theo 2021 年 3 月 20 日
thank you for your help

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by