Making loop to create graphs

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.

Réponses (1)

Voss
Voss le 19 Août 2022

0 votes

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

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Question posée :

le 19 Août 2022

Réponse apportée :

le 19 Août 2022

Community Treasure Hunt

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

Start Hunting!

Translated by