Making loop to create graphs
조회 수: 1 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!