This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Computing the mean of a vector.
- From: Brian Gough <bjg at network-theory dot co dot uk>
- To: Daniel T Konkle <daniel dot konkle at dynetics dot com>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Mon, 19 May 2003 10:36:34 +0100
- Subject: Re: Computing the mean of a vector.
- References: <5.2.1.1.2.20030514151110.44ccd390@mailhub.dynetics.com>
Daniel T Konkle writes:
> I'm looking through the Reference Manual & I'm trying to figure out
> if there is a way to call the gsl_mean function but pass it a
> vector. I can't figure out how to access the data in the function:
> so for: double gsl_stats_mean( const double data[], size_t stride,
> size_t n) can I call it like this:
>
> m = gsl_stats_mean( v->data, v->stride, v->size )
>
That's the way that I recommend.
If you need to use it often you can define your own macro or function
for it.
--
Brian