updated cprintf for compatibility with recent matlab versions