Dear there,
I am reading a dataset into a two dimensional array, and trying to
calculate the columnwise mean of it. The result is a disaster. It
seems that the column.vector.data is not the first column I wanted.
Since most gsl_stats functions need input of double array or matrices,
I would like to know how you deal with this situation. Please cc my
email address as well, thanks!
double data[m][n];
FILE * in = fopen("kenneth48monthvalueweight.dat","r");
gsl_matrix_fscanf(in,&vdata.matrix);
gsl_matrix_view vdata = gsl_matrix_view_array (data[0],m,n);
for (i=0;i<n;i++){
gsl_vector_view column = gsl_matrix_column (&vdata.matrix, i);
mean[i]=gsl_stats_mean(column.vector.data,1,m);
}
--
Best regards,
Mike
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl