pcode
Create content-obscured, executable files
Syntax
Description
pcode(
obfuscates the code in a item).m file or folder on the search path and
produces P-code files with the extension .p. For example, if
item is a .m file named
mytest.m, then the resulting file is
mytest.p. If item is a folder, then all
script or function files in that folder are obfuscated and saved in the current
folder. A P-code file takes precedence over the corresponding .m
file for execution, even after modifications to the .m
file.
Note
Security Considerations: The
pcode function produces MATLAB® program files in a proprietary, obfuscated code format.
Consider combining multiple approaches to protect sensitive code or data.
For more information, see Security Considerations to Protect Your Source Code.
pcode( creates the P-code
files using a more complex obfuscation algorithm. Files obfuscated in this way run
only in MATLAB R2022a and later.item,"-R2022a")
pcode( creates the P-code
files using the default, legacy algorithm.item,"-R2007b")
pcode(
creates P-code files from each item1,item2,...,itemN).m file or folder specified in a
comma-separated list.
pcode(___,"-inplace") creates
the P-code files in the same folders as the inputs. Specify
"-inplace" after any of the input argument combinations in
the previous syntaxes.
If the source file resides within a namespace or class folder, then
pcode creates the same namespace or class structure to house
the resulting P-code files.