You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

14 lines
400 B

% 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 int %s[]={\n", array_name);
for m=1:length(array)-1
fprintf(f," %f,\n",array(m));
endfor
fprintf(f," %f\n};\n",array(length(array)));
fclose(f);
endfunction