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.

1 次查看(过去 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