This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Computing the mean of a vector.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]