comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: 3D matrix
items: Re: 3D matrix

3D matrix
type: item
description: Hi I have a 3D matrix A = Array[100, 200, 200] A = [time, x, y] I want to create a matrix B which is the average of the first 10 time points (total is 100 time points). I should end up with a 2D matrix B=Array[200,200]. Can anyone help please?
creator: g.nacarts
date: 2014-12-04T11:09:26-00:00

Re: 3D matrix
type: item
description: On Thursday, December 4, 2014 12:09:29 PM UTC+1, g.na...@gmail.com wrote: > Hi > > I have a 3D matrix A = Array[100, 200, 200] > A = [time, x, y] > > I want to create a matrix B which is the average of the first 10 time points (total is 100 time points). I should end up with a 2D matrix B=Array[200,200]. > > Can anyone help please? How about b = mean(a[0:9,*,*],dimension=1) is this what you mean? Helder
creator: Helder Marchetto
date: 2014-12-04T11:18:06-00:00

Re: 3D matrix
type: item
description: dimension keyword is not allowed in call to mean. I tried the b = mean(a[0:9,*,*]) but I end up with a single value which is not what I need.
creator: g.nacarts
date: 2014-12-04T11:45:25-00:00

Re: 3D matrix
type: item
description: I have an old version of IDL 6.4. I don't know if this causes the problem and I can't use the keyword dimension
creator: g.nacarts
date: 2014-12-04T11:53:06-00:00

Re: 3D matrix
type: item
description: On Thursday, December 4, 2014 12:45:26 PM UTC+1, g.na...@gmail.com wrote: > dimension keyword is not allowed in call to mean. > > I tried the b = mean(a[0:9,*,*]) but I end up with a single value which is not what I need. IDL> a = findgen(100,200,200) IDL> b = mean(a[0:9,*,*], dimension=1) IDL> help, b B FLOAT = Array[200, 200] IDL> !version { "ARCH": "x86_64", "OS": "Win32", "OS_FAMILY": "Windows", "OS_NAME": "MicrosoftWindows", "RELEASE": "8.4", "BUILD_DATE": "Sep272014", "MEMORY_BITS": 64, "FILE_OFFSET_BITS": 64 } I guess you don't have the latest version of IDL. Well, calculating the mean is not that difficult: b = total(a[0:9,*,*], 1)/10.0 Cheers, Helder
creator: Helder Marchetto
date: 2014-12-04T11:55:14-00:00