fB = fopen( 'private/B.m', 'w' ); fprintf( fB, "function B()\n disp( 'Hello from B' )\n C()\nend\n" ); fclose( fB );