How to use coder.ceval to fprintf a new line ?
Show older comments
Matlab R2012b does not support fprint for code generation, so I am using coder.ceval to call the C fprintf function. The problem is on printing a new line, infact the instruction coder.ceval(‘fprintf’, f, ‘%lf\n‘, 10.0); produces as output in the file 10.000000\n €ÿ Moreover the instructions coder.ceval(‘fprintf’, f, ‘%lf\n‘, 10.0); coder.ceval(‘fprintf’, f, ‘%lf\n‘, 20.0); produce as output in the file 10.000000\n&bÿ20.000000\n
How is possible to get the new line?
It can be useful to underline that using printf instead of fprintf the problem does not exist
Accepted Answer
More Answers (1)
ilker ozturk
on 1 Aug 2017
0 votes
Have you solved this problem? I get same result as your problem. If you solved this problem could you write to me? In addition, When I push to start button in matlab function, Matlab has closed. I think, its a bug but I dont know how to pass this problem. (Matlab relase is Matlab 2012a )....
Have a good day..
1 Comment
Giulia Coluccini
on 21 Aug 2017
Edited: Giulia Coluccini
on 21 Aug 2017
Categories
Find more on MATLAB Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!