Help creating a 3D array

1 次查看(过去 30 天)
I currently have 27 Matlab files that I have been able to load. Each Matlab file has a 2D x-velocity field that shows up as a 40x50 Matrix.
I am trying to create a 3D array so that I can find the average of each point (i.e. avg of all i1j1s's) for all 27 files.
So far, the last step i have done is
for n=1:27:
...............................
xData = load(filename,'x');
I tried doing A(:,:,n)=xData, but I am unsure how to average from that set of data.
**TO CLARIFY:
The issue I am having right now is that the A(:,:,n)=xData makes an array of 1x1x27. I want to create an array that is 40x50x27

采纳的回答

Walter Roberson
Walter Roberson 2015-11-18
fileData = load(filename,'x');
xData = fileData.x;
load() of a .mat file returns a structure with fields named after the variables loaded.

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by