Voice Lab
save_plot
void save_plot(double **matrix, int order, int num_vectors, char *file_name, int options)
{
int i, j, offset;
FILE *out_file;
if((out_file = fopen(file_name,"w")) == NULL) {
fprintf(stderr, "Cannot open output file: %s\n", file_name);
exit(1);
}
offset = 0x01 & options;
for(i = 0; i < num_vectors; i++) {
for(j = offset; j < (order + offset); j++) {
fprintf(out_file, "%d, %d, %f\n", j, i, matrix[i][j]);
}
fprintf(out_file, "\n");
}
fclose(out_file);
}
No comments:
Post a Comment