How do I get project to include P-Code so that the code can be referenced by another project?
6 次查看(过去 30 天)
显示 更早的评论
I have some old proprietry code provided by another Business Unit. To protect the IP the code has been saved as P-Code. The P-Code was created a while ago (probaby using MATLAB 2014 or 2016).
We are currently using 2018b but will (hopefully) be moving to 2020a soon. I have therefore tested the P-Code directly and can confirm that it all still runs.
We are developing new tools to use the functionality provided by the P-Code. However, when a new Project is created from the folder none of the P-Code is included in the project. This means that we are unable to reference the project, to use the P-Code, from our development project.
Any suggestions on how to get project to include the P-Code?
1 个评论
Walter Roberson
2020-7-24
What happens if you specifically add it to the project ? such as with the -a command line flag.
回答(1 个)
Fraser Macmillen
2020-8-10
Hi Kevin
So it is correct that "when a new Project is created from the folder none of the P-Code is included in the project" - this is because P-code files are seen as derived files and not included by default (the same would be true of .slxp). Whether this is the right thing to do we could debate... but....
The initial set up of a project does not limit subsequent addition to / customisation of the project - so one can certainly add .p & .slxp files to a project. This can be done the usual way via the Project view, select the "All" tab and then select the .p files and right click to add to the project:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/344107/image.jpeg)
Using the API would an alternative.
Projects I think can be very helpful when dealing with I.P. For example, say an OEM has a project "A" that needs models, utilities etc from a supplier, but those models/utilities need to be obfuscated. The supplier in turn has a project "B" that contains their models/functions, etc. These files that the suplier controls can be labelled "unrestricted", "protected" etc. The supplier can then make a second project "Bshared" that is automatically populated from project B with files as appropriate - i.e. all "protected" labelled files would be protected and the .p/.slxp files saved into Bshared. Bshared may then be shared directly with the OEM as a complete project, either via a common GitHub type set-up or via project archives. This process can be highly automated - I can share an example if helpful.
Hope this helps answer your question
Best Regards
Fraser
1 个评论
Fraser Macmillen
2020-8-10
One more thing....
If prior to creating a project from folders the files in the folders are already committed in a recognised source control tool (git/svn) then when the project is first created all files that are under source control will be added to the project from the outset (including protected files) - just so you know!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programming Utilities 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!