Borrar filtros
Borrar filtros

Making loop to create graphs

1 visualización (últimos 30 días)
Lia Kirtadze
Lia Kirtadze el 19 de Ag. de 2022
Respondida: Voss el 19 de Ag. de 2022
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.

Respuestas (1)

Voss
Voss el 19 de Ag. de 2022
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

Categorías

Más información sobre Specifying Target for Graphics Output en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by