P-code is a preparsed and encoded version of the M-file. Since it is preparsed, it saves on the load time of the function.
Matlab is very fast at parsing, so the Pcode function rarely makes much of a speed difference. One situation where P-code
does provide a speed benefit is for large GUI applications. In this case, many M-files must be parsed before the
application becomes visible. Another situation for P-code is when, for proprietary reasons, you want to hide algorithms you've
created in your M-file. Pcoded files can not be edited and/or modified. Careful, there is no way to convert P-code back to the
M-file source. P-code is platform independent.
Download source code