필터 지우기
필터 지우기

Hello everyone, how do you average the 10 largest data in u(m/s) in each .txt file in a file set? Then draw these data. Thank you very much.

조회 수: 2 (최근 30일)

채택된 답변

Image Analyst
Image Analyst 2021년 11월 22일
fileList = dir('PIV*.txt');
for k = 1 : length(fileList)
thisFileName = fullfile(fileList(k).folder, fileList(k).name);
dataStructure = importdata(thisFileName)
data = dataStructure.data;
% Get u from column 3.
u = data(:, 3);
% Get 10 largest
big10 = maxk(u, 10)
% Get the mean
mean10 = mean(big10)
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by