Master of MATLAB 7.0 hybrid programming, edited by Yang gaobo P30, Electronic Industry Press
M Files have convenient matrix and Array Operations, and have high programming efficiency, but low computing efficiency, that is, they are common to traditional Fortran, C/C ++, etc.Programming LanguageCompared with M that implements the same functionCodeIt is more concise and efficient, but the operation time is longer.
M file reviewer:
MATLAB provides an optimization and debugging tool called profile to help usersProgramTo find out which codes are the most time-consuming.
Profile keywords can be: On, off, resume, clear, viewer, etc.
Example:
> Profile on
> Plot (MAGIC (35 ))
> Profile Viewer
> Profsave (profile ('info'), 'profile _ results ')
Profile on-History
Plot (MAGIC (4 ));
P = profile ('info ');
For n = 1: size (P. functionhistory, 2)
If P. functionhistory (1, N) = 0
STR = 'entering function :';
Else
STR = 'exiting function :';
End
Disp ([str p. functiontable (P. functionhistory (2, n). functionname)]);
End