diff options
Diffstat (limited to 'gsl-1.9/doc/examples/vectorr.c')
-rw-r--r-- | gsl-1.9/doc/examples/vectorr.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gsl-1.9/doc/examples/vectorr.c b/gsl-1.9/doc/examples/vectorr.c new file mode 100644 index 0000000..203986b --- /dev/null +++ b/gsl-1.9/doc/examples/vectorr.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include <gsl/gsl_vector.h> + +int +main (void) +{ + int i; + gsl_vector * v = gsl_vector_alloc (10); + + { + FILE * f = fopen ("test.dat", "r"); + gsl_vector_fscanf (f, v); + fclose (f); + } + + for (i = 0; i < 10; i++) + { + printf ("%g\n", gsl_vector_get(v, i)); + } + + gsl_vector_free (v); + return 0; +} |