- The P file is a pre-parsed version (preparsed version) corresponding to the M file ). Because when you execute the M file for the first time, Matlab needs to parse the file (PARSE) Once (the parsed content after the first execution will be placed in the memory for the second execution, that is, the second execution does not need to be parsed), which virtually increases the execution time. So we will explain it in advance. When we use the M file later, the corresponding resolved version, namely the P file, will be executed directly. However, because the MATLAB resolution speed is very fast, you do not need to perform pre-Resolution on your own. Only when someProgramPre-resolution is performed only when a lot of M files are called, such as GUI applications, to increase the call speed in the future.
- P files can be used for confidentialityCodeIf you give someone an M file, someone else can open it to see all your code andAlgorithm. If your code is not visible to others, you can give it a P file.
- The pcode function can also be applied to the m function file.
MATLAB command: pcode
PcodeFun
Pcode *. m
PcodeFun1 Fun2...
Pcode...-inplace
Description
PcodeFunObfuscates (I. e .,Shrouds) M-FileFun. mFor the purpose of protecting its proprietary source code. The encrypted M-code is written to P-FileFun. pIn the current directory. The original M-file can be anywhere on the search path.
If the input file resides within a package and/or class directory, then the same package and class directories are applied to the output file. See example 2, below.
Pcode *. mCreates p-files for all the M-files in the current directory.
PcodeFun1 Fun2...Creates p-files for the listed functions.
Pcode...-inplaceCreates p-files in the same directory as the M-files. An error occurs if the files cannot be created.
Original: http://www.cnblogs.com/feisky/archive/2009/10/25/1589622.html