How to get the version of MATLAB on which P-file had built?

4 次查看(过去 30 天)
I have some set of p-file which are not running on MATLAB 2016b version. These p-codes are working fine on MATLAB 2011b, which I am currently using. According to the MATLAB help documents, the older version of the P-codes won't work on MATALB 2015b and later versions. So, I won't to know, on which version of MATLAB my p-codes has been created? If it was created using older version of MATLAB (before R2007), then I can make my self sure that, I don't have any option and I have to get back to the developer to rebuild the p-code on new MATLAB.
Please help me to get out of it.

回答(1 个)

Jan
Jan 2016-12-17
When I open P-coded files as text files, e.g. by fileread, I find a suspicious header in the first bytes:
  • P-coded in 2015b:
v01.00v00.00 ...
  • P-coded in 2009b:
v00.00v00.00 ...
  • P-coded in R6.5:
P-file 2.8
This looks promissing. Unfortunately it is not consistent and the bunch of zeros looks like someone has reserved some characters for future enhancements, but did not implement it explicitely.
The encryption of the Matlab 6 P-files has been weak. I did not examine this in detail and doing this might even conflict with the license conditions (revers engineering?). But it was easy to adjust e.g. strings in the code by changing bytes of the P-file -- as far as I can imagine changing bytes by trial and error cannot be illegal. But for you this might be useful: Change any byte (the 1019th e.g.) and try to start the P-coded function. If it does not crash immediately, it was encoded by Matlab < v7. Modern P-files get invalid if their contents is modified. (At least this is step towards a strong encryption, but I'd still hesitate to treat this undocumented file format as a secure method for storing private data.)
Ask TMW if the "v.01.00" is a secure marker for modern P-files. Or send your files to TMW to let them examine this detail.
In my tests I can start the P-file encoded in R2015b under 2009b and the other way around. So the question is, if the incompatibilities really exist. Please explain, where in the docs you found the information about the incompatibility. Perhaps it concerns the graphics interface only and is not a problem of P-coding.

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by