I'm doing a simulation using for cycle. In this simulation I have a series of fprintf that print out information. To improve the performance of my simulation I created a custom fprintf
if debug ~= 0
When debug is setted to 1, fprintf prints out the arguments passed. The problem is that examinating my code with profiler I see that when for cycle is executed for 10e6, the simulation spend too many time in custom_fprintf function. Which could be the way to improve this situation?