|
|
|
Re: Averaging of my observations [message #93256 is a reply to message #93255] |
Sun, 22 May 2016 08:50   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
The MEAN() function will return a vector of values if you use the DIMENSION keyword.
On Sunday, May 22, 2016 at 10:49:11 AM UTC-4, AGW wrote:
> On Sunday, May 22, 2016 at 3:42:49 PM UTC+2, AGW wrote:
>> Hi, I have observation saved as .save files
>> I want to take Averaging for all observations.
>> How can I do it?
>
> thank you, but the result of mean function is one value, I want to take average for four dimensions.
|
|
|
|
Re: Averaging of my observations [message #93260 is a reply to message #93257] |
Mon, 23 May 2016 05:42  |
Mats Löfdahl
Messages: 263 Registered: January 2012
|
Senior Member |
|
|
Den måndag 23 maj 2016 kl. 13:39:48 UTC+2 skrev AGW:
> IDL> y=mean(x,dimension=1)
> % Keyword DIMENSION not allowed in call to: MEAN
> % Execution halted at: $MAIN$
OK, you are using IDL version < 8.
You can use total() instead of mean, and divide by the number of summed items. total() does support the dimension to sum over since before IDL 8, although not as a keyword but as the second parameter.
So you could do something like
IDL> dim=1
IDL> y=total(x,dim)/(size(x,/dim))[dim-1]
|
|
|