How do I programmatically save the output of "C" code generation to a "cpp" file?
I am doing all of these in Matlab via the Maple engine, which is version 10, I guess.
I cannot seem to do "writeto" redirection here, because Matlab doesn't allow that I guess.
And I like to use "fprintf" because it gives me more control of the code that is generated...
If it works, I no longer need copy and paste..
But it didn't work at all. There was no error message, but the file was empty...
Can anybody tell me why?
fd:=fopen("trygenC.cpp", WRITE, TEXT)
aa:=proc(x, m) S:=Array([0, 0]); for k from 1 to m do S:=S+x[1, k]; S:=S+(x[2, k])^2; od; S end proc
fprintf(fd, %Q, C(bb, optimized))