how to encrypt matlab code
mcc is Matlabs m to C Converter/Compiler
you need Microsoft Visual Studio installed so you could compile the "m" to "C" files to exe
but for these exe (or dll) files to run you'll need the Matlab Run-time installed (about 200M) and they are slow!
And for the security of p files ? try it out, the output is unreadable by humans, the source for pcode is not open so how it does what it does I don't know. a Mathworks employ could probably break p files but for the rest of us, I don't think so.
Added after 5 minutes:
How to convert m files to p files is easy as pie
Write your m files, test them, and then just pcode them:
pcode *.m (backup your m-files and distribute only the p files they run just like any matlab program)
Added after 2 minutes:
And as an added bonus p-files run much faster then m-files They are acutely preparsed so at run-time there is no need for extra parsing