Anyways let’s come to the topic, today I am gonna post about how to protect your code in MATLAB. Like you are some sort of developer and you have created some code for a company and now you want to protect your and just send the company some sort of software. MATLAB has a function in which you convert your m-file into p-file and no one can open that p file code. P-file functionality is as same as of m-file but no one can check what’s inside p-file.
Creating P-file from m-file
- Suppose you have created your m-file and you are now want to protect your code and the send the rest to your employer so that he can use it without knowing the code inside it.
- Use these command to do this :
- If fun is the name of the m-file then MATLAB will conver the fun.m to fun.p and create it in the same folder.
- If fun is the name of the folder then MATLAB will convert all the m-files within that folder into p-files.
- If you want to convert more than one m-file into p-file then use the second code and place all the m-files there.
- You can also convert more than one folder using the second command.