Matlab P文件——加快Matlab程序,保护你的算法(z)
2010-07-31 21:31
459 查看
P文件是对应M文件的一种预解析版本(preparsed version)。因为当你第一次执行M文件时,Matlab需要将其解析(parse)一次(第一次执行后的已解析内容会放入内存作第二次执行时使用,即第二次执行时无需再解析),这无形中增加了执行时间。所以我们就预先作解释,那么以后再使用该M文件时,便会直接执行对应的已解析版本,即P文件。但又因为Matlab的解析速度非常快,一般不用自己作预解析。只有当一些程序要调用到非常多的M文件时,如GUI应用程序时,才会作预解析,以增加以后的调用速度。
P文件可以用来作保密代码之用,如果你给别人一个M文件,别人可以打开来看到你所有的代码和算法。如果你的代码不想被别人看到,那可以给他P文件。
pcode函数也可以应用在M函数文件。
Matlab命令:pcode
pcode fun
pcode *.m
pcode fun1 fun2 ...
pcode... -inplace
[b]Description[/b]
pcode fun obfuscates (i.e., shrouds) M-file fun.m for the purpose of protecting its proprietary source code. The encrypted M-code is written to P-file fun.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 *.m creates P-files for all the M-files in the current directory.
pcode fun1 fun2 ... creates P-files for the listed functions.
pcode... -inplace creates P-files in the same directory as the M-files. An error occurs if the files cannot be created.
原帖:/article/4716074.html
P文件可以用来作保密代码之用,如果你给别人一个M文件,别人可以打开来看到你所有的代码和算法。如果你的代码不想被别人看到,那可以给他P文件。
pcode函数也可以应用在M函数文件。
Matlab命令:pcode
pcode fun
pcode *.m
pcode fun1 fun2 ...
pcode... -inplace
[b]Description[/b]
pcode fun obfuscates (i.e., shrouds) M-file fun.m for the purpose of protecting its proprietary source code. The encrypted M-code is written to P-file fun.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 *.m creates P-files for all the M-files in the current directory.
pcode fun1 fun2 ... creates P-files for the listed functions.
pcode... -inplace creates P-files in the same directory as the M-files. An error occurs if the files cannot be created.
原帖:/article/4716074.html
相关文章推荐
- Matlab P文件——加快Matlab程序,保护你的算法(z)
- Matlab P文件——加快Matlab程序,保护你的算法
- Matlab P文件——加快Matlab程序,保护你的算法
- Matlab P文件——加快Matlab程序,保护你的算法
- 使用md5校验和算法保护文件(算法/原理/程序)
- TLD算法matlab版本的程序调试过程
- 嵌入式小波零树(EZW)算法的过程详解和Matlab代码(2)编码过程(081227-补充quantifier程序)
- 保护PC程序的高速软件加密锁及其自定义算法的实现
- MATLAB加快程序运行的方法:逻辑数组与向量化
- 基本粒子群算法matlab 程序
- .net程序中资源文件的保护办法探讨
- .net程序中资源文件的保护办法探讨
- 将MATLAB程序打包为jar文件的时候遇到的问题
- matlab的使用问题(—):每次双击.m文件都会自动打开一个matlab程序
- FIT文件格式解析及MATLAB读取程序
- 读取siftgeo格式文件的matlab程序
- 保护PC程序的高速软件加密锁及其自定义算法的实现
- .net程序中资源文件的保护办法探讨
- 使用md5校验和算法保护文件
- 用c语言移植matlab算法程序一点小小的经验