#include "header.h" gsl_matrix_float ReadMatrix() { char MatrixFileName[MAXFILELEN]; //declare the file name gsl_matrix_float Matrix; //declare a temporary matrix scanf("%s", MatrixFileName); // read the matrix file name from the data file FILE *fIn; // declare the file int Rows, Columns; fIn=fopen(MatrixFileName,"r"); fscanf(fIn,"%d",&Rows); //read the rows and columns of the Matrix fscanf(fIn,"%d",&Columns); Matrix=*gsl_matrix_float_alloc(Rows,Columns); //allocate memory for the matrix gsl_matrix_float_fscanf (fIn,&Matrix); // puts values from the file to the matrix fclose(fIn); return Matrix; }