how to take average of velocity matrix

3 views (last 30 days)
vijay mulchandani
vijay mulchandani on 26 Nov 2012
I have 200 result matrix which contains matrixes of individual variables. one of the variable is velocity v of 98x124. i need something which does the mean of velocity from each of 200 matrixes into a 1x124 matrix(like a loop or something) and finally does the mean of all these individual mean velocity matrix. So at the end i will just have one mean velocity matrix of 1x124.
  2 Comments
Image Analyst
Image Analyst on 26 Nov 2012
What do you mean? How can your matrix contain other "matrixes of individual variables" with each element ("variable") in those matrixes being a 98 by 124 matrix in itself? Do you have 3 levels deep of matrices????
And what is a "200 result matrix"? Is that one matrix, or 200 separate matrices?
vijay mulchandani
vijay mulchandani on 27 Nov 2012
For example i have one Pivlab.mat file in which there are matrices of x and y coordinates and u and v components of fluid, and all of them are of size 98x124. now what i want is to take the mean of just v component and make it to 1x124. i have this type of 200 mat files, and at the end what i need is a result matrix in which i have the mean of all these 200 v component mean.

Sign in to comment.

Answers (1)

Matt J
Matt J on 26 Nov 2012
Edited: Matt J on 26 Nov 2012
Rewrite/rerun the code that created the 200 separate matrices so that instead you have one array that is 98x124x200. Then do
mean(mean(A,1),3)
  2 Comments
vijay mulchandani
vijay mulchandani on 26 Nov 2012
i get this separate matrices after processing the images in pivlab ....so its not possible to get it in one array coz i have 200 separate pair of images and the result output of each pair is separate...
Matt J
Matt J on 26 Nov 2012
Well, put them in that form in some other way, then. You obviously have a way of loading them into MATLAB, so load them one by one and stack them into 98x124x200 array.

Sign in to comment.

Categories

Find more on Mechanical Engineering in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!