Making loop to create graphs

1 回表示 (過去 30 日間)
Lia Kirtadze
Lia Kirtadze 2022 年 8 月 19 日
回答済み: Voss 2022 年 8 月 19 日
I have multiple .txt files with inone folder and I am making graphs based on this data
Is it possible to make some kind of loop to make matlab do it automaticlly.

回答 (1 件)

Voss
Voss 2022 年 8 月 19 日
Something along these lines:
folder = 'your\folder\path';
files = dir(fullfile(folder,'*.txt'));
hold on
for ii = 1:numel(files)
data = readmatrix(fullfile(folder,files(ii).name));
plot(data(:,1),data(:,2));
end

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by