n=359;
a=[];
b=[];
c=[];
% for loop
for i=1:n
filename=sprintf('output_%d.dat',i);
fileinfo = importdata(filename);
ux=fileinfo.data(:,7); % extract column data
uy=fileinfo.data(:,8);
uz=fileinfo.data(:,9);
a=[a,ux]; % put all Ux in an array
b=[b,uy];
c=[c,uz];
end
aver_Ux=sum(a,2)/n; % sum of array elements
aver_Uy=sum(b,2)/n;
aver_Uz=sum(c,2)/n;
*********
- [[https://www.mathworks.com/help/matlab/ref/sum.html?searchHighlight=sum&s_tid=doc_srchtitle][sum]]
* average vector from multiple files--Matlab
原创
©著作权归作者所有:来自51CTO博客作者凯明的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:plot3d
下一篇:BC in fluent
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Upload multiple files with a single file element
用一个文件域上传多个文件,无意中找到了,很不错,有空再翻译一下。
上传 休闲 upload 多个文件 一个文件域 -
Leetcode: Moving Average from Data Stream
Queue method: Array method: 非常聪明
Leetcode Window Queue 编程题目