## Digital Signal Processing Library

### Voice Lab

Program name: save_plot

Language: C

In file: file_lib.c

Objective: Write plot info to file.

Usage: void save_plot(double **matrix, int order, int num_vectors, char *file_name, int options);

Parameters:

• matrix - list of vectors to plot.
• order - width of vectors.
• num_vectors - number of vectors in list
• file_name - name of file to open and plot vectors to
• options -
Return:
• void

Mathematical Description:

Comments: Routine is used to save vectors in a format that gnuplot can read and 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);}`
{"ft_lang_label":"__label__en","ft_lang_prob":0.5838337,"math_prob":0.63300216,"size":543,"snap":"2020-45-2020-50","text_gpt3_token_len":128,"char_repetition_ratio":0.12059369,"word_repetition_ratio":0.16,"special_character_ratio":0.22836095,"punctuation_ratio":0.22,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9895546,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-12-04T01:44:58Z\",\"WARC-Record-ID\":\"<urn:uuid:415ace5c-cc7e-4146-a980-6edf5cdda616>\",\"Content-Length\":\"50454\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:99117358-3b0b-4508-8927-08a94c720602>\",\"WARC-Concurrent-To\":\"<urn:uuid:5eb77f03-f09e-4384-bbd5-2a4e354ef79d>\",\"WARC-IP-Address\":\"142.250.73.243\",\"WARC-Target-URI\":\"http://rrbrandt.dee.ufcg.edu.br/en/docs/phd/routines/file_lib/save_plot\",\"WARC-Payload-Digest\":\"sha1:O6VAECXW7XBJTVKEXEE7GQU672XVCIRZ\",\"WARC-Block-Digest\":\"sha1:W6JJQOYMNFDDEEER5OIZYFWGJLTN5MEX\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141733120.84_warc_CC-MAIN-20201204010410-20201204040410-00493.warc.gz\"}"}