I have a 7426x32 2D array of data from a 1deg cylindrical slice. It contains: X,Y,Z, and a 29 variables such as temperature, density, pressure, etc. There are 79 mesh nodes in the X direction, 2 in the Y, and 47 in the Z. It's one 'line' of cell volumes in the Y direction. The data is written out in this manner:
do Z = 1,47
do Y = 1,2
do X = 1,79
X,Y,Z, then the other 29 variables at each node
enddo
enddo
enddo
I need to interpolate the variables to get the average value of a variable in each cell volume (which makes 3713 values), multiply each to the volume contained in each cell, and then sum that all up. I understand that I can use interp3 function in Matlab, but I'm not really certain how to get the function to work with the data that I have.
'Gut instinct' tells me I should have:
Vq = interp3(A(1:79,1),A(1:79,2),A(1:79,3),A(1:79,30))
To get the variable in the 30th column. But it's not really working, and I'm not sure how it works with the way my data is arranged. Could anyone point me in the right direction?
Thank you very much!
A
? – Karlo