Help creating a 3D array

1 Ansicht (letzte 30 Tage)
Jon Marks
Jon Marks am 18 Nov. 2015
Beantwortet: Walter Roberson am 18 Nov. 2015
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

Akzeptierte Antwort

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

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by