From ac7c48b4dee99d4c772f133d70d8d1b38262fcd2 Mon Sep 17 00:00:00 2001 From: Author Name Date: Fri, 7 Jul 2023 12:20:59 +0930 Subject: shallow zip-file copy from codec2 e9d726bf20 --- octave/save_array_c_header.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 octave/save_array_c_header.m (limited to 'octave/save_array_c_header.m') diff --git a/octave/save_array_c_header.m b/octave/save_array_c_header.m new file mode 100644 index 0000000..1fd87bb --- /dev/null +++ b/octave/save_array_c_header.m @@ -0,0 +1,14 @@ +% save_array_c_header.m +% +% David Rowe Sep 2015 + +function save_array_c_header(array, array_name, filename) + f=fopen(filename,"wt"); + fprintf(f,"/* Generated by save_array_c_header.m Octave function */\n\n"); + fprintf(f,"const float %s[]={\n", array_name); + for m=1:length(array)-1 + fprintf(f," % .16f,\n",array(m)); + endfor + fprintf(f," % .16f\n};\n",array(length(array))); + fclose(f); +endfunction -- cgit v1.2.3