Corrected write_c_struct matlab function

master
ismagom 9 years ago
parent 13ac13464c
commit 1348b2b4bc

@ -7,7 +7,9 @@ function [ out ] = write_c_struct_complex( filename, varname, x)
return return
end end
fprintf(tidin, 'float %s[%d]={%.9g,%.9g',varname,2*length(x),real(x(1)),imag(x(1))); fprintf(tidin, 'float %s[%d]={%.9g,%.9g',varname,2*length(x),real(x(1)),imag(x(1)));
fprintf(tidin, ',\n %.9g,%.9g',real(x(2:end)),imag(x(2:end))); for i=2:length(x)
fprintf(tidin, ',\n %.9g,%.9g',real(x(i)),imag(x(i)));
end
fprintf(tidin, '};\n'); fprintf(tidin, '};\n');
fclose(tidin); fclose(tidin);
end end

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save